Open source virtualization KVM, network setup (two)

Part we learned to build the KVM

Now we learn the virtual machine's network settings

Build a bridge

If you are installing kvm virtual machines within a local area network, in order to facilitate the connection and maintenance management, network mode kvm virtual machines we recommend using Bridge mode (in addition to NAT mode), so kvm virtual machine and the host will be in the same network segment , other hosts on the LAN directly connected

1. Check the host card information
ip a, or ifconfig a
general name for the physical NIC eth0, eth1 or beginning ens, etc., is ens33 on my native
copy ens33 card configuration file to br0 file
cd / etc / sysconfig / network- scripts /
CP-ens33 the ifcfg the ifcfg-BR0

2. The host physical NIC configuration
vim ifcfg-ens33

Open source virtualization KVM, network setup (two)

Bridge card configuration

vim ifcfg-br0

Open source virtualization KVM, network setup (two)

Restart Service

[root@localhost network-scripts]# service network restart

[root@localhost network-scripts]# brctl show

Open source virtualization KVM, network setup (two)
As the investigation on the map, indicating the bridge successfully created
last virtual machine set up card type

Open source virtualization KVM, network setup (two)

Open source virtualization KVM, network setup (two)

Assign a same segment of the IP, internal - external - you can access the network with each other
Open source virtualization KVM, network setup (two)

PS:
after installing KVM will find the network interface in more than a virtual network interface called virbr0 of:

This is because the system is installed and enabled generation after libvirt and services, libvirt generate a virtual network switch (virbr0) on the server (host), all virtual machines (guests) on the host through this virbr0 linked up. By default virbr0 using NAT mode (using IP Masquerade), so the guest can access the external host through this case.

virbr0 is a Bridge KVM created by default, its role is to provide NAT functionality to access the virtual machine network card to connect its network on the outside ---.
virbr0 assigned a default IP 192.168.122.1, and provide DHCP services to other virtual card to connect to it.
Most of the time the virtual machine using a bridge (bridge) directly connected to the LAN, so this virbr0 not required (Note: Do not be confused, bridge and virbr0 bridge here is unrelated)

You can delete virbr0 not affect the KVM network.

Guess you like

Origin blog.51cto.com/4690837/2445251