Configuration of bridging in KVM (Ubuntu)

Source: Internet
Author: User
I have installed KVM, but I find that the network connection mode is NAT, which is very uncomfortable, because I often need to make a stop and test between several different virtual machines, so today I have studied the bridge mode. For details about KVM installation, see environment: Ubuntu12.04 + KVM. First, stop the network service sudo/etc/init. d/networkingstop. Second, modify the network configuration file sudogedit/etc/network/interf.

I have installed KVM, but I find that the network connection mode is NAT, which is very uncomfortable, because I often need to make a stop and test between several different virtual machines, so today I have studied the bridge mode.

For details about KVM installation, refer:

Environment: Ubuntu 12.04 + KVM

First, stop the network service.

Sudo/etc/init. d/networking stop

Second, modify the network configuration file

Sudo gedit/etc/network/interfaces

If you want to manually set the ip address, copy the following code to the edited file. Note: you can modify the IP address and other settings as needed.

Auto lo
Iface lo inet loopback
Auto eth0
Iface eth0 inet manual
Auto br0
Iface br0 inet static
Address 192.168.200.130
Network 192.168.200.0
Netmask 255.255.255.0
Broadcast 192.168.200.255
Gateway 192.168.200.1
Dns-nameservers 8.8.8.8
Bridge_ports eth0
Bridge_stp off
Bridge_fd 0
Bridge_maxwait 0

To automatically obtain the code from DHCP, copy the code to the edited file.

Auto lo
Iface lo inet loopback
Auto eth0
Iface eth0 inet manual
Auto br0
Iface br0 inet dhcp
Bridge_ports eth0
Bridge_stp off
Bridge_fd 0

Finally, restart the network service.

Sudo/etc/init. d/networking restart

After the NIC is configured, you must configure the VM.

Open the VM controller:

Sudo virt-manager

Change the network attribute of the virtual machine to br0.

Example:

After setting the KVM bridging problem in the above steps, the problem still persists. The wireless Nic bridging is unsuccessful. The default is the wired Nic!

If you have any questions during use, please contact us!

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.