HomePage » Linux » LinuxNICBonding

NIC Bonding


Modern servers comes with more than 1 ethernet inferface, and is perfect for use with NIC bonding. Basically, load are distributed among interfaces, and in case one of the NIC or link becomes unavailable, the IP address is still served by the remaining interface.

Advanced binding (such as load balancing with cisco switch)
http://www.cyberciti.biz/howto/question/static/linux-ethernet-bonding-driver-howto.php

Setup for ES5
Create the bond0 if script
ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.1.2
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
BONDING_OPTS="mode=1 miimon=100"
MTU=9000


Probe the module and bring it up
modprobe bonding mode=1 miimon=100
ifup bond0




Setup for RHEL
Go into /etc/sysconfig/network-scripts, and reference the following config files:

ifcfg-bond0
# bonded interface
DEVICE=bond0
BOOTPROTO=static
BROADCAST=1.2.3.255
IPADDR=1.2.3.4
NETMASK=255.255.255.0
NETWORK=1.2.3.0
ONBOOT=yes
USERCTL=no


ifcfg-eth0
# Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none


ifcfg-eth1
# Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none


Then edit modules.conf so that the OS recognized /dev/bond0
modules.conf
alias eth0 tg3
alias eth1 tg3
alias bond0 bonding
options bond0 mode=balance-alb miimon=100
#
# For multiple nic bonding
#
# This will give you the same option on all bondings
alias bond0 bonding
alias bond1 bonding
options bonding miimon=100 mode=6 max_bonds=2
# This give you different options on each bonding
alias bond3 bonding
options bond1 -o bonding3 miimon=100 mode=1


Restart networking
# modprobe bonding
# service network restart


Testing
less /proc/net/bonding/bond0
ifconfig -a
Comments [Hide comments/form]
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki