#- VDE2 #- (ref: http://vde.sourceforge.net) #- VDE can be used to configure QEMU Guest access to the local HOST network: #- (ref: http://people.redhat.com/berrange/olpc/sdk/network-bridge.html) #- (ref: http://blog.bravecobra.com/index.php/linux?p=41&more=1&page=2) vde_switch -tap tun -daemon ifconfig tun 192.168.193.225 # (some free subnet & ip address) chmod 666 /tmp/vde.ctl # allow users control access #- Use ifconfig to verify whether the TUN device has the specified IP address: ifconfig #- TUN address acts as the GATEWAY for the QEMU Guest. #- Set TUN gateway to forward packets to eth0 (our LAN/Internet connection) #- To do this we use iptables: echo "1" > /proc/sys/net/ipv4/ip_forward # allow forwarding iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE vdeqemu -hda hd.img -boot c # EXAMPLE QEMU INVOCATION #- In QEMU configure networking to use another IP in the local subnet with a #- gateway corresponding to the TUN device IP: #- * IP: 192.168.193.226 (some free address in our new subnet) #- * subnetmask: 255.255.255.0 #- * gateway: 192.168.193.225 (HOST TUN device) #- * DNS: set it the same as your host OS