Centos 6 Bonded network interfaces

February 01, 2013 at 07:40 AM | categories: Sysadmin, Tips, Centos | View Comments

Bonding allows you to aggregate multiple ports, providing redundancy, fault tolerance and load balancing.

There are various types of bonding available but i will show how to bond in mode 1 which is active-backup. If your interested in the other available types please refer to the documentation.

In this setup i have two connections to different switches in case one fails the other takes over and services are not disrupted.

Setup bonded interface

Create a file in /etc/modprobe.d called bond.conf and add the following

alias bond0 bonding

Create the bonded interface file /etc/sysconfig/network-scripts/ifcfg-bond0 with the following contents

DEVICE=bond0
IPADDR=xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="bond0 miimon=80 mode=1"

Modify the interfaces you want to bond to look like:

DEVICE=ethX
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes

Restart networking for the changes to take effect:

service network restart

Checking the status

You can check the status of the interface by running:

cat /proc/net/bonding/bond0

blog comments powered by Disqus