How to configure bridge interface for KVM slave node?
The article describes how to set up a dedicated network bridge for Linux KVM virtualization. It presumes the network interface is eth0 and the bridge will be called br0.
Warning: The actions described below are dangerous and can cause loosing of remote access to the server. It is recommended to have direct access to the server in order to revert the changes back in case of emergency.
- Connect to the slave KVM node via SSH
Bridging requires the bridge-utils package to be installed on the server. To check if it's installed, do the following:
# rpm -q bridge-utils
If there is an output in the command above - it's installed, if not, it needs installing:
# yum install bridge-utils
- The example of the network configuration file is below:
- Create a copy of the network interface:
# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/backup-ifcfg-eth0
- Create the bridge file:
# nano -w /etc/sysconfig/network-scripts/ifcfg-br0
- Copy network configuration settings from ifcfg-eth0 to ifcfg-br0 file to make it look like below:
- Edit the ifcfg-eth0 as below:
- Restart the network service to apply the changes:
# service network restart