1. Create a virtual bridge with the Brctl command br0
Brctl ADDBR Br0
Ifconfig br0 up//Two commands above will cause network disconnection
2. Bind the virtual bridge BR0 with the physical NIC Eth0
Brctl addif br0 eth0
Ifconfig eth0 0.0.0.0//bridge is similar to a switch, it can be considered that the eth0 is just a port on the switch, you can think of all packets from the eth0, but ultimately by the bridge to determine the flow of packets, so as long as the IP of the bridge is labeled, the port does not need
3. Assigning IP to BR0 using DHCP
Dhclient br0
4. Create a virtual Tap network card
Tunctl-b-T tap0//ubuntu under TUNCTL installation command: sudo apt-get install uml-utilities
Ifconfig tap0 up
Brctl addif br0 tap0
5. Create a virtual machine and associate the network card
sudo qemu-system-x86_64 ubuntu-15.04-snappy-amd64-generic.img-m 1024-net nic-net Tap,ifname=tap4,script=no,down Script=no-enable-kvm
A tap virtual network card is inserted when QEMU starts