[Debian] Network bonding

Network bonding is a technique that ‘bind’ multiple network interfaces into a single channel/NIC in order to increase redundancy or throughput.

Depending the operating system other term are used like :

  • OpenBSD: network trunking
  • Cisco: Etherchannel
  • HP-UX: Auto-port
  • AIX: Link-aggregation

Don’t be fooled by marketing term, in the end the concept is always to aggregate multiple interfaces into a single virtual one.

If you want to increase redundancy your ideal setup should be aggregating two interfaces using two different network cards connected to two separate switches. The bonding will be in active / passive mode, only using one port a time. This setup not only ensures high availability operation, but more importantly, allows for maintenance of network switches without service interruption.

Here’s how to make the bonding on Debian Lenny :

Prerequisites

  • install ifenslave
  • kernel module ‘bonding’ loaded

Modify network setting

lenny:~# vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto bond0
iface bond0 inet static
      slaves eth0 eth1
      bond_mode active-backup
      bond_miimon 100
      bond_downdelay 200
      bond_updelay 200
      address xxx.xxx.xxx.xxx
      netmask xxx.xxx.xxx.xxx
      network xxx.xxx.xxx.xxx
      gateway xxx.xxx.xxx.xxx
lenny:~# /etc/init.d/networking restart

The slaves command specify which interfaces to aggregate, and bond_mod how. Here we use active-backup but if you setup bonding in order to increase throughput check the balance_rr mode instead.

Further Reading and sources

Leave a Reply

Your email address will not be published. Required fields are marked *