KVM virtualization is not described much. By default, KVM virtualization only supports the NAT connection mode. If it is used as a testing machine, it is sufficient, but if it is used as a server, it will be very tangled. In wmware, the nat network interface is generally vnic 8. You can connect the network interface card of the virtual machine to vnic 8 to implement NAT, vnic 2 is a bridge connecting to wmwareesxi. You can create a vswitch, bridge it, or create a private virtual network. In KVM, you can only NAT and create private
Not much about KVM Virtualization
By default, KVM virtualization only supports the NAT connection mode. If it is used as a testing machine, it is sufficient, but if it is used as a server, it will be very tangled.
In wmware, the nat network interface is generally vnic 8. You can connect the network interface card of the virtual machine to vnic 8 to achieve NAT. The virtual network interface card 1 is only the local machine, and the virtual network interface card 2 is a bridge.
In wmware esxi, you can create a vswitch, bridge the switch, or create a private virtual network.
In KVM, only NAT and private virtual networks can be created. Therefore, you need to modify the network configuration of the host.
Do not talk nonsense
# Cat ifcfg-eth0 [root @ CWG network-scripts] #
DEVICE = "eth0"
BOOTPROTO = "static"
HWADDR = "54: 04: A6: A7: FF: 6C"
NM_CONTROLLED = "yes"
ONBOOT = "yes"
TYPE = "Ethernet"
UUID = "9b1c6600-538a-440d-8c93-144598dc5fa4"
IPADDR = "192.168.0.100"
NETMASK = "255.255.255.0"
GATEWAY = "192.168.0.1"
DNS1 = "202.106.46.151"
DNS2 = "202.106.195.68"
BRIDGE = "br0" // Add such a sentence "br0" to name the virtual BRIDGE to be created
Then create the profile ifcfg-br0 and create the ifcfg-sw0 if it is not br0 but sw0, and if it is aaa, create ifcfg-aaa
My BRIDGE name is br0, and the following content is created:
# Cat ifcfg-br0 [root @ CWG network-scripts] #
DEVICE = "br0" // The DEVICE name, which must be the same as that in BRIDGE = "" and the name ifcg-"" of the BRIDGE configuration file.
TYPE = "Bridge" // specify the Bridge TYPE
NOBOOT = "yes"
BOOTPROTO = "static"
IPADDR = "192.168.0.100"
NETMASK = "255.255.255.0"
GATEWAY = "192.168.0.1"
DNS1 = "202.106.46.151"
DNS2 = "202.106.195.68"
DELAY = "0" // monitor the mac address in the traffic.
Then the service network restart
[Root @ www.linuxidc.com] # ifconfig
Br0 Link encap: Ethernet HWaddr 54: 04: A6: A7: FF: 6C
Inet addr: 192.168.0.100 Bcast: 192.168.0.255 Mask: 255.255.255.0
Inet6 addr: fe80: 5604: a6ff: fea7: ff6c/64 Scope: Link
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 119 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 0 (0.0 B) TX bytes: 5310 (5.1 KiB)
[Root @ CWG network-scripts] # brctl show
Bridge name bridge id STP enabled interfaces
Br0 8000.5404a6a7ff6c no eth0 // visible br0 is a bridge that inherits the eth0 parameter. Then, the KVM virtual machine can bridge to this bridge to access the Internet, and the Internet to access the guest.
Virbr0 8000.525400aef573 yes virbr0-nic
Virbr1 8000.525400c3b070 yes virbr1-nic
The physical Nic is successfully shared by the kvm vm! You can also create a bridge for one network card, which can reduce the load on one network card!
Recommended reading:
Build a virtual machine environment KVM-QEMU Based on http://www.linuxidc.com/Linux/2013-06/86566.htm in Ubuntu 12.10
CloudStack 4.0 + KVM Installation Guide http://www.linuxidc.com/Linux/2013-06/85750.htm
Installation of KVM virtual machine case http://www.linuxidc.com/Linux/2013-05/84981.htm in CentOS 6.3
KVM Virtual Machine Nginx Performance Test http://www.linuxidc.com/Linux/2013-02/78992.htm
RHEL6 KVM virtualization configuration summary http://www.linuxidc.com/Linux/2011-02/32722p3.htm
For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10