CentOS 7 KVM Hypervisor Bonded Bridged NIC’s

Bridging a Bonded  Network CentOS 7

This is exclusively for a KVM Hypervisor running Centos 7 with at least 2 Network cards (NIC’s) but may work on other Linux Flavors.

Bridging a Bonded  Network Centos 7

This is exclusively for a KVM Hypervisor running Centos 7 with at least 2 Network cards (NIC’s) but may work on other Linux Flavors.

  1. Disable and stop network manager: systemctl disable NetworkManager && systemctl stop NetworkManager

  1. Navigate to the network scripts folder on your server or workstation:

cd /etc/sysconfig/network-scripts/

  1. Use the following command to ensure bonding modules are installed and supported: modprobe bonding. You won’t get output if it is installed and supported.
  2. Then run; modinfo bonding. You will get output like this, the output is truncated.

  1. Configure your nics:

NIC 0:

TYPE=Ethernet

BOOTPROTO=none

DEVICE=en01

ONBOOT=yes

HWADDR=”70:E2:84:05:74:E3

MASTER=bond0

SLAVE=yes

 

NIC 1:

TYPE=Ethernet

BOOTPROTO=none

DEVICE=en02

ONBOOT=yes

HWADDR=”70:E2:84:05:74:E4

MASTER=bond0

SLAVE=yes

 

  1. Create your Bond: vi ifcfg-bond0

 

Insert the following:

TYPE=Bond

NAME=bond0

BONDING_MASTER=yes

BOOTPROTO=none

ONBOOT=yes

IPADDR=192.168.1.200  — ensure this matches your subnet

NETMASK=255.255.255.0

GATEWAY=192.168.1.1

BONDING_OPTS=”mode=5 miimon=100″

 

  1. Restart your network: systemctl restart network –ensure you can connect and  ssh into the server and then test the bond: ifdown eno1 to ensure you can still connect, etc. Try it on the NIC’s one at time. Ifdown/ifup <name of NIC>

 

  1. Now we can Bridge the bonded pair.
  2. vi ifcfg-virbr0
  3. Insert the following:

DEVICE=”virbr0″

BOOTPROTO=”static”

IPADDR=”192.168.1.200″ — This is the same IP, subnet and gateway from                                                               the bond. Now the bridge will have the IP info.

NETMASK=”255.255.255.0″

GATEWAY=”192.168.1.1″

DNS1=”192.168.1.201″

DNS2=”192.168.1.222″

DNS3=”192.168.1.232″

ONBOOT=”yes”

TYPE=”Bridge”

NM_CONTROLLED=”no”

 

  1. Next edit the bond you just created and tested by removing the IP address, subnet and gateway you just added to your bridge. At the bottom of the bond0 add BRIDGE=virbr0, the name of the bridge you just created.

  1. Once you have saved the Bridge, restart your network and test. If all went well, you have a bonded, bridged pair for your KVM Hypervisor.

Hits: 104

2 thoughts on “CentOS 7 KVM Hypervisor Bonded Bridged NIC’s”

  1. Pingback: URL

Leave a Reply