Comment 6 for bug 125302

Revision history for this message
Ace Suares (acesuares) wrote : Re: kvm-ifup fails to bring up tap0 in feisty

Running Gutsy (7.10) 32bit.

I start the guest with:

kvm -hda guest.img -m 1024 -net nic -net tap

Starting the guest gives the same error:

can't add tap0 to bridge eth1: Operation not supported

But the tap0 device exists:

7: tap0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 500
    link/ether 00:ff:87:13:e9:96 brd ff:ff:ff:ff:ff:ff
    inet 10.20.30.40/8 brd 10.255.255.255 scope global tap0
    inet6 fe80::2ff:87ff:fe13:e996/64 scope link
       valid_lft forever preferred_lft forever

After the guest has started, on the guest, I execute:

ifconfig eth0 10.20.30.50 netmask 255.255.255.0
route add default gw 10.20.30.40
echo "MY-NAMESERVER-IP" > /etc/resolv.conf

and on the host:

ifconfig tap0 10.20.30.40
modprobe ip_tables
modprobe iptable_nat
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

and it works both ways: from the guest I can reach internet and from the host I can ssh into the guest.

Good luck!
Ace