With bridged networking you can share actual network device with KVM machines. This is required for servers with multiple network cards and gives you good performance. You can choose to put multiple segments into one bridged network or to divide it into different networks interconnected by router
s.
Our Sample Setup
The following describes the networking used by our setup:
Where,
- All other clients can reached to all VMs via br1 which is connected to public interface. br1 is our default gateway.
- br0 is connected to private LAN to access other servers, services and storage devices such as SAN/NAS or NFS servers. br0 route is configured via route-br0 static networking configuration file.
Turn Off NetworkManager
The NetworkManager (GUI) tool can create problems with bridged based networking so disable it as follows, enter:
# chkconfig NetworkManager off
# chkconfig network on
# service NetworkManager stop
Edit /etc/sysconfig/network, enter:
# vi /etc/sysconfig/network
Update file as follows:
NETWORKING=yes HOSTNAME=kvm42.nixcraft.net GATEWAY=br1
Save and close the file.
br0: Configure Bridging for eth0
Edit /etc/sysconfig/network-scripts/ifcfg-eth0, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Update it as follows:
DEVICE=eth0 ONBOOT=yes ETHTOOL_OPTS="autoneg off speed 100 duplex full" BRIDGE=br0 HWADDR=b8:ac:6f:65:31:e5
Save and close the file. Create /etc/sysconfig/network-scripts/ifcfg-br0, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-br0
Update it as follows (note options are case sensitive i.e. Bridge and bridge are two different options)
DEVICE=br0 TYPE=Bridge BOOTPROTO=static ONBOOT=yes IPADDR=10.10.21.70 NETMASK=255.255.255.192 DELAY=0
Save and close the file. Finally, create static routing file /etc/sysconfig/network-scripts/route-br0, enter :
# vi /etc/sysconfig/network-scripts/route-br0