set tap0 using virt-manager for bridged wireless

Posted by DaveO on Server Fault See other posts from Server Fault or by DaveO
Published on 2010-11-02T04:13:06Z Indexed on 2012/04/01 17:33 UTC
Read the original article Hit count: 269

After 3 days I finally have kvm guests working on the network via wireless (link below - thanks!):

My network is 192.168.1.0/24

on the host:

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo tunctl -t tap0
sudo ip link set tap0 up
sudo ip addr add 192.168.1.25/24 dev tap0
sudo route add -host 192.168.1.30 dev tap0
sudo parprouted wlan0 tap0

on the guest:

auto eth0
iface eth0 inet static
  address 192.168.1.30
  netmask 255.255.255.0
  network 192.168.1.0
  broadcast 192.168.1.255
  gateway 192.168.1.25

and start the guest:

sudo kvm /path/to/guest.img -net nic,macaddr=DE:AD:BE:EF:90:26 -net tap,ifname=tap0,script=no

This works great and I can ping the local network and the internet back and forth between the guest.

But how do I add these settings to the guest's xml config so I can start the guest via virt-manager with the same nic settings?

ref:

© Server Fault or respective owner

Related posts about wireless-network

Related posts about kvm-virtualization