Fedoara14 and RHEL6 [kvm] provide three types of configuration support for virtualization. networkAddressTranslation [NAT] 2. directly allocate the physical device [PCIpassthroughorSR-IOV] 3. the shared physical device [Bridge] is enabled by default. If you want to access a VM over the Internet, you can directly allocate physical devices or Bridge the network. NAT: almost all standard libvirt Support NAT
Fedoara 14 and RHEL 6 [kvm] provide three types of configuration support for virtualization,
1. Network Address Translation [NAT]
2. Direct Allocation of physical devices [PCI passthrough or SR-IOV]
3. Shared physical device [Bridge]
NAT is enabled by default. If you want to access virtual machines through the Internet, you can directly allocate physical devices or bridge the network.
NAT:
Almost all standard libvirt Support NAT as the virtual network [default virtual network], and virsh net-list -- all can be viewed.
# Virsh net-list -- all
Name State Autostart
-----------------------------------------
Default active yes
If the corresponding xml configuration file is lost, you can extract it from the template:
# Virsh net-define/usr/share/libvirt/networks/default. xml
Then, identify the virtual network as auto start:
# Virsh net-autostart default
# Virsh net-start default
View the bridging status. virbr0 is connected to the physical network through NAT and IP Forwarding, and no other interfaces are added.
# Brctl show
Bridge name bridge id STP enabled interfaces
Virbr0 8000.000000000000 yes
Generally, libvirt automatically adds some rules to iptables and tries to enable the ip_forward function. However, other applications may disable ip_forward, so it is best to add one in/etc/sysctl. conf:
Net. ipv4.ip _ forward = 1
Briged:
NetworkManager is generally used on multiple Nic machines. NetworkManager does not support bridging. Therefore, you must disable the NetworkManager service or add the 'nm _ CONTROLLED = no' parameter to the configuration file of the network device.
# Vim/etc/sysconfig/network-scripts/ifcft-eth0
DEVICE = eth0
HWADDR = 00: 16: 76: D6: C9: 45
ONBOOT = yes
BRIDGE = br0
Add br0 Configuration
DEVICE = br0
ONBOOT = yes
TYPE = Bridge
BOOTPROTO = dhcp
DELAY = 0
Restart NETWORK SERVICE
Service network restart
Brctl View
# Brctl show
Bridge name bridge id STP enabled interfaces
Br0 8000. f0def1341ae6 no eth0
Virbr0 8000.000000000000 yes
Configure iptables to allow traffic forwarding over the bridging network [physdev module is used]
# Iptables-I FORWARD-m physdev -- physdev-is-bridged-j ACCEPT
You can also configure the following kernel parameters:
Net. bridge. bridge-nf-call-ip6tables = 0
Net. bridge. bridge-nf-call-iptables = 0
Net. bridge. bridge-nf-call-arptables = 0