Page tree
Skip to end of metadata
Go to start of metadata

Network Bridge

Make sure that bridge-utils package is installed on the server:

# rpm -qa | grep bridge-utils

bridge-utils-1.5-9.el7.x86_64

Install, if necessary:

yum install bridge-utils

Bridging is our choice of network configuration on the hypervisor so you will need to make sure you have a persistent bridge setup. Don't rely on scripts to do this for you, automation of bridge activation are prone to errors.

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
NETWORK=102.100.152.0
ONBOOT=yes  

To back up your current ifcfg-eth0 before modification:

1. Run the following command:

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

2.Create the bridge file:

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

3. 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
NETWORK=102.100.152.0
ONBOOT=yes 

4. Save that file then edit ifcfg-eth0:

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

5. 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 

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

systemctl restart network

7. Once it's restarted you will see the new bridge using the ifconfig command:

[root@dev1 ~]# ip addr
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master xenbr0 state UP qlen 1000
    link/ether 00:23:8b:aa:42:3a brd ff:ff:ff:ff:ff:ff
    inet6 fe80::223:8bff:feaa:423a/64 scope link
       valid_lft forever preferred_lft forever
7: xenbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 00:23:8b:aa:42:3a brd ff:ff:ff:ff:ff:ff
    inet 199.43.199.114/24 brd 199.43.199.255 scope global xenbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::223:8bff:feaa:423a/64 scope link
       valid_lft forever preferred_lft forever
  • No labels