A tap virtual network card is inserted when QEMU starts

Source: Internet
Author: User

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

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.