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!