Posts Tagged ‘bond’

Setup Bonded Interfaces On Linux

Monday, July 6th, 2009

Here's a real quick and easy process to set up network interface bonding on your Fedora, CentOS or Redhat box.  It assumes that your kernel already supports bonding and that your distro supports master/slave notation in the network interface configs.  Recompiling the kernel and/or installing ifenslave is beyond the scope of this article

Create bond0

cat /etc/sysconfing/network-scripts/ifcfg-bond0

DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no

Make eth0 and eth1 slaves of bond0

cat /etc/sysconfig/network-scripts/ifcfg-eth0

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

cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=no

Edit modprobe.conf

cat /etc/modprobe.conf

# bonding commands
alias bond0 bonding
options bond0 mode=1 miimon=100

In the above, mode=1 is for failover and miimon=100 is to monitor link every 100 ms.  You can use mode=0 for round-robin, miimon=100 should probably stay just like that.

Load bonding driver and restart network, or reboot your computer.

$ modprobe bonding; service network restart

or

$ reboot now

You now have bonding configured!