Full patch 20160831112618-c9899-f46a10ef523f8228740d89ea3cec9b089ca5d858

Wed Aug 31 11:26:18 UTC 2016  Alexander Markov <apsheronets@gmail.com>
 * internetz

en/howto-two-way-networking-for-qemu-and-kvm
@@ -7,9 +7,20 @@
bc[shell]. sudo kvm -net tap,script=/etc/kvm/kvm-ifup -net nic -m 256 -hda debian-lenny.img -curses
ifconfig tap0 192.168.5.1

On

In a virtual machine:

bc[shell]. echo 'iface eth0 inet static
        address 192.168.5.2
        netmask 255.255.255.0
        gateway 192.168.5.1' >> /etc/network/interfaces

h2. Can I haz internets on my guest now?

On a host system:

bc[shell]. # echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

In a guest system:

bc[shell]. # echo 'nameserver 8.8.8.8' > /etc/resolv.conf