Wednesday, October 31, 2007

Updated: Redhat Linux RHEL 4 NIC Bonding

Update: The below configuration for multiple bonded interface *does* work, but involves loading the bonding driver multiple times using precious system resources.

The other option is to use the following in modprobe.conf

alias bond0 bonding
alias bond1 bonding
options bond0 miimon=100 mode=1 max_bonds=2
options bond1 miimon=100 mode=1 max_bonds=2


This will only load the module once, and setup 2 (as specified by max_bonds) bonded interfaces in it's initialisation. However this means that if you wanted to add another bonded interface at a later date you would have to re-load the bonding driver causing the other bonded interfaces to be disrupted.

I can't see any reason why using both config simultaneously wouldn't work. So intially you could setup modprobe.conf with the above config, and then add some of the config below to setup a new interface with no down time.

i.e:

# Inital 2 Bonded interfaces
alias bond0 bonding
alias bond1 bonding
options bond0 miimon=100 mode=1 max_bonds=2
options bond1 miimon=100 mode=1 max_bonds=2

# Additional (temporary) bonded interface:
alias bond3 bonding
options bond1 -o bonding3 miimon=100 mode=1


Alternatively, setting max_bonds to a high number such as 8 or 16 would also help solve this issue, but would leave you with a large number of unused interfaces.




Using RedHat Enterprise 4, I was having major trouble getting multiple bonded interfaces to work.

I tired:

/etc/modprobe.conf:
alias bond0 bonding
alias bond1 bonding
options bond0 miimon=100 mode=1
options bond1 -o bonding1 miimon=100 mode=1


But I kept getting the error:

[root@newbuild ~]# ifup bond1
bonding device bond1 does not seem to be present, delaying initialization.


However bond0 would come up at boot time fine.

When trying /sbin/modprobe bond1 manually there was nothing returned, no log entries created and no interface appeared. Adding the options to modprobe directly worked correctly:

/sbin/modprobe bonding -o bonding1 miimon=100 mode=1


I eventually solved the problem by completely removing the above configuration and putting the following in /etc/modprobe.conf:

install bond0 /sbin/modprobe bonding -o bonding0 miimon=100 mode=1
install bond1 /sbin/modprobe bonding -o bonding1 miimon=100 mode=1


And finally both bonded interfaces initialized correctly.

Wednesday, October 03, 2007