Skip to content

Bridge configuration for Xen Slave

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.

1. Connect to the slave KVM node via SSH

2. Disable Network Manager as it may interfere with the bridge.

systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
systemctl enable network.service
systemctl start network.service

3. Additionally, it makes sense to review the network configuration file, e.g. /etc/sysconfig/network-scripts/ifcfg-eth0 and verify that it is disabled there as well

NM_CONTROLLED=no

4. Install bridge-utils package:

yum install bridge-utils

5. We presume the network interface is eth0 and the bridge will be called xenbr0 throughout this setup. Xenbr0 is the default that Xen will use. Before setting up your bridge, the contents of /etc/sysconfig/network-scripts/ifcfg-eth0 will look like the following:

DEVICE=eth0
BOOTPROTO=static
BROADCAST=102.100.152.255
HWADDR=00:27:0E:09:0C:B2
IPADDR=102.100.152.2
IPV6INIT=yes
IPV6_AUTOCONF=yes
NETMASK=255.255.255.0
GATEWAY=102.100.152.1
ONBOOT=yes
NM_CONTROLLED=no

6. Back up your current ifcfg-eth0 before modification. Run the following command:

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /root/backup-ifcfg-eth0

7. Create the bridge file

nano -w /etc/sysconfig/network-scripts/ifcfg-xenbr0

8. Copy parts of ifcfg-eth0 to it:

DEVICE=xenbr0
TYPE=Bridge
BOOTPROTO=static
BROADCAST=102.100.152.255
IPADDR=102.100.152.2
NETMASK=255.255.255.0
GATEWAY=102.100.152.1
ONBOOT=yes
NM_CONTROLLED=no

9. Save that file then edit ifcfg-eth0:

nano -w /etc/sysconfig/network-scripts/ifcfg-eth0

10. Remove the networking parts and specify the bridge:

DEVICE=eth0
HWADDR=00:27:0E:09:0C:B2
IPV6INIT=yes
IPV6_AUTOCONF=yes
ONBOOT=yes
BRIDGE=xenbr0
NM_CONTROLLED=no

11. The bridge is now set up. Make sure that the changes are correct and restart the networking:

systemctl restart network