Etherchannel / Bonding / Port-channel – Network Redundancy for Servers


Server Configuration

Depending on the OS and Network Interface hardware vendor, the configurations may vary.

Redhat Enterprise Linux 5+

With the Linux kernel, ether-channel configuration is standardized, and common NIC drivers should support bonding out of the box. The below configurations have been tested with Intel Pro 1000 Server NIC and Broadcom Netextreme II that comes with modern Dell servers.

WARNING: Before you begin, I recommend that you have regular console root access to the system in case you lose connectivity due to misconfiguration.

First Step:

Verify and Ensure the Linux “bonding” module is loaded:

lsmod | grep bonding

Insert the module if it is not loaded by issuing:

modprobe bonding
Second Step:

Edit the “/etc/modprobe.conf” file and add an alias with bond0 to create the virtual adapter.

alias bond0 bonding

Note: For Redhat 6+ “/etc/modprobe.conf” has been deprecated. Create a new file called “bonding.conf” under “/etc/modprobe.d/” directory with the above statement.

Third Step:

Navigate to the “/etc/sysconfig/network-scripts/” and start by modifying the “ifcfg-<int>” files that are to be added to the bonded interface.

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

Set the interface to slave and point the master to bond0.

Move on to the next interface that is to be added to the bond and repeat the above configuration.

Fourth Step:

Next, create a new configuration file “ifcfg-bond0”

DEVICE=bond0
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
DHCP_HOSTNAME=SERVER1.example.com
BONDING_OPTS="mode=4 miimon=100 lacp_rate=1"

Mode 4 sets the ether-channel mode to use LACP.

You may want to define the hardware mac address of the bonded interface if static DHCP assignments based on mac address is used. With Linux ether-channel bonding, the first interface in the bond, in this case eth0 will always be used as the mac address of the virtual interface. If a new network interface is inserted or replaced, verify the order of the NIC that appears in /etc/modprobe.conf as it may have been reshuffled. Also make sure to update the DHCP server scripts accordingly with the new mac address.

NOTE: When using DHCP for bonded interfaces if you get the following message at boot or network restart:

Determining IP information for eth0… failed; no link present. Check cable?

Add the following line to the ifcfg-bond0 config file:

check_link_down () { return 1; }

I’ve notice this happens with BNX2 (Broadcom) NICs and not E1000.

BNX2 Drivers seems to fail to detect link state when it’s brought up. The work around is to force a return value of 1.

Step 5
service network restart

Restart the network and reboot to verify the interfaces will come up

Related Posts with Thumbnails

About the Author

Alfred Tong
Author and owner of this blog. A Networking enthusiast, full time networking and systems Engineer. Generally curious about all things IT.Certifications: GIAC GSEC, CCNP-S, CCNP, CCSP, CCDP, CCNA, RHCE, JNCIA - FWV