When QEMU is started, the tap virtual network card and qemutap virtual network card are inserted.

Source: Internet
Author: User

When QEMU is started, the tap virtual network card and qemutap virtual network card are inserted.

1. Use the brctl command to create a virtual bridge br0

Brctl addbr br0

Ifconfig br0 up // the preceding two commands are executed separately, leading to network disconnection.

 

2. Bind the virtual bridge br0 to the physical Nic eth0.

Brctl addif br0 eth0

Ifconfig eth0 0.0.0.0 // The net bridge is similar to a switch. In this case, you can think that eth0 is only a port on the switch. You can think that all data packets are imported from eth0, but the net bridge decides the packet flow, therefore, you only need to mark the IP address of the bridge.

 

3. Use DHCP to assign IP addresses to br0

Dhclient br0

 

4. Create a virtual TAP Nic

Tunctl-B-t tap0 // ubuntu tunctl installation command: sudo apt-get install uml-utilities

Ifconfig tap0 up

Brctl addif br0 tap0

 

5. Create a VM and associate the NIC

Sudo qemu-system-x86_64 ubuntu-15.04-snappy-amd64-generic.img-m 1024-net nic-net tap, ifname = tap4, script = no, downscript = no-enable-kvm

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.