this is obsolete doc -- see http://doc.nethence.com/ instead

Network interface bonding 

 

 

On Redhat systems 

First, note down your MAC addresses to keep track of what's going on once bonding is activated, 

ifconfig eth0 | grep HWaddr
ifconfig eth1 | grep HWaddr

then create a virtual network interface configuration, 

cd /etc/sysconfig/network-scripts
vi ifcfg-bond0

for example, 

DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes

Note you can also specify “GATEWAY=” here or in the /etc/sysconfig/network configuration file. 

 

Backup the old interfaces configurations, 

cd /etc/sysconfig/network-scripts
mv ifcfg-eth0 OLD.ifcfg-eth0
mv ifcfg-eth1 OLD.ifcfg-eth1

Note it's preferable not to start your own filenames with ifcfg (scripts are going to parse them) hence the “OLD” prefix. 

 

Create the interfaces configurations, 

cd /etc/sysconfig/network-scripts
vi ifcfg-eth0

for example, 

DEVICE=eth0
MASTER=bond0
SLAVE=yes
ONBOOT=yes

then, 

vi ifcfg-eth1

for example, 

DEVICE=eth1
MASTER=bond0
SLAVE=yes
ONBOOT=yes

 

Add the bonding configuration, 

vi /etc/modprobe.conf
alias bond0 bonding
options bond0 miimon=100 mode=1

Note mode=1 is for HA failover. mode=0 is for load balancing (teaming) 

Note miimon=100 means the link is going to be checked every 100 milliseconds 

 

At last restart the network, 

service network restart

Note the bonding module is loaded automaticly, just like any other network interface module, 

lsmod | grep bond

 

For other /etc/modprobe.conf parameters, 

modinfo bonding

Note it's always possible to unload and reload the bonding module while concerned interfaces are down, just like other network interface modules, 

service network stop
rmmod bonding
modprobe bonding
service network start

 

To see what's going on when you unplug a cable, 

tail -F /var/log/messages

To check if a interface is currently enslaved, trying to enslave it manually will tell you, 

ifenslave bond0 eth0

Ref. man ifenslave 

or just look into, 

cat /proc/net/bond0/info