Aug 30 2008

Channel Bonding on Linux

Published by at 3:02 pm under Linux




Channel bonding – or port truncking – gives the ability to apply a policy to a group of network interfaces. It is then possible to load-balance the traffic accross different ports, or keep one aside for failover.
 

Module Loading

Declare the channel bonding bond0 interface into /etc/modprobe.conf

# Channel Bonding
alias bond0 bonding
options bond0 miimon=100 mode=1
# You can add more with alias bond1 and so on

Here mode is 1, meaning in a failover state. Another useful mode is 0, that load-balances the traffic sequencially.
 

Interfaces

On Redhat/Suse, usual configuration files can be used. Bond0 includes eth0 and eth1 in this case.
 
– /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
IPADDR=192.168.1.2
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no

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

HWADDR=00:1F:39:56:DF:C0
ONBOOT=yes
DEVICE=eth0
MASTER=bond0
SLAVE=yes

 
– /etc/sysconfig/network-scripts/ifcfg-eth1

HWADDR=00:1F:39:56:DF:C1
ONBOOT=yes
DEVICE=eth1
MASTER=bond0
SLAVE=yes

 
A reboot and you’re done!


No responses yet

Comments RSS

Leave a Reply