quickhowto: qemu networking using vde, tun/tap, and bridge

Not require to configure firewall/routing. Much more simple to setup. Do not need root privilege to run qemu. Easy to use. Tested and working.

qemu vde tun tap bridge

Diagram: qemu vde tun tap bridge

# brctl addbr br0
# brctl addif br0 eth0
# dhclient br0
# vde_tunctl -u testuser -t tap0
# ifconfig tap0 up
# brctl addif br0 tap0
# brctl setfd br0 0

$ vde_switch -d -s /tmp/vde0 -M /tmp/vde0mgmt
$ vde_plug2tap -d -s /tmp/vde0 tap0

$ vdeqemu -hda testdisk1.qcow2 ... -net nic,macaddr=... -net vde,sock=/tmp/vde0
$ vdeqemu -hda testdisk2.qcow2 ... -net nic,macaddr=... -net vde,sock=/tmp/vde0

Thanks to: julius, shammash, and eric