NIC Bonding On Debian Lenny

Ethernet bonding refers to aggregating multiple ethernet channels together to form a single channel. This is primarily used for redundancy in ethernet paths or for load balancing. This page refers in particular to performing ethernet bonding under Linux, and so does not limit itself to discussion of 802.3ad Trunk Aggregation.


Ethernet Bonding Types

The Linux kernel bonding module supports a number of bonding types.

mode=0 (balance-rr)
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

mode=1 (active-backup) 

One slave interface is active at any time. If one interface fails, another interface takes over the MAC address and becomes the active interface. Provides fault tolerance only. Doesn’t require special switch support

mode=2 (balance-xor) 

Tranmissions are balanced across the slave interfaces based on ((source MAC) XOR (dest MAC)) modula slave count. The same slave is selected for each destination MAC. Provides load balancing and fault tolerance.

mode=3 (broadcast) 

Transmits everything on all slave interfaces. Provides fault tolerance.

mode=4 (802.3ad) 

This is classic IEEE 802.3ad Dynamic link aggregation. This requires 802.3ad support in the switch and driver support for retrieving the speed and duplex of each slave.

mode=5 (balance-tlb) 

Adaptive Transmit Load Balancing. Incoming traffic is received on the active slave only, outgoing traffic is distributed according to the current load on each slave. Doesn’t require special switch support

mode=6 (balance-alb) 

Adaptive Load Balancing - provides both transmit load balancing (TLB) and receive load balancing for IPv4 via ARP negotiation. Doesn’t require special switch support, but does require the ability to change the MAC address of a device while it is open.


Set Up Bonding Ethernet on Debian

To use Bonding Ethernet for High-Availability (fail-over) on Debian Lenny you need to:

Install package ifenslave-2.6. To install this package follow this command:

#apt-get install ifenslave-2.6

Make sure the real NICs kernel modules are loaded automatically.

Edit /etc/network/interfaces to look like this:

iface bond0 inet static
up /sbin/ifenslave bond0 eth0 eth1
down /sbin/ifenslave -d bond0 eth0 eth1

Comment or borrow the lines referring to your real NICs in the same file.

Add the following lines to your /etc/modprobe.d/arch/i386:

alias bond0 bonding
options bonding mode=5 miimon=100 downdelay=200 updelay=200

Make sure you change your mode!

Then restart your networking:

#/etc/init.d/networking restart

Share this page:

13 Comment(s)

Add comment


From: at: 2009-04-21 20:36:08

Before running:

/etc/init.d/networking restart

Make sure to shutdown each of your slave interfaces using ifconfig (ifup will not work, as it refers to /etc/network/interfaces for interface config info which won't be there any more).

ifconfig eth0 down
ifconfig eth1 down

etc. Then run:

ifup bond0
/etc/init.d/networking restart

You should be golden! Special thanks to:

From: Anonymous at: 2009-03-20 20:37:51

right but using the interface file for the full configuration is a much better way to do it because its modular and you don't have the configuration spread across multiple files.  Its also the way the README file in the package explains.  Why even bother updating the howto for lenny if its not going to be done any differently than previous releases?

From: at: 2009-03-19 10:40:23

Many men many minds. In my opinion it's easier to use modprobe

From: Anonymous at: 2009-03-17 12:25:14

On debian you don't need to use up/down lines nor /etc/modprobe.d things. just configure bond intreface this way:

 iface bond0 inet static
        bond_mode balance-tlb
        bond_miimon 100
        bond_downdelay 200
        bond_updelay 200
        slaves eth0 eth1

From: at: 2009-03-16 22:41:54

Thanks for fixing!

From: Anonymous at: 2009-03-05 08:04:51

It might be smart (and nice) to combine the up lines into a single statement:

 up ifenslave bond0 eth0 eth1 eth2 eth3 <etc>

 and also to clean up after oneself on shutdown:

 down ifenslave -d bond0 eth0 eth1 eth2 eth3 <etc>

From: at: 2009-03-15 14:07:49

dont forget about round robin mode.

mode=0 (balance-rr)
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

From: Anonymous at: 2009-03-11 10:56:28

Note that on debian lenny mii is a kernel module.

$ grep CONFIG_MII /boot/config-2.6.26-1*


So you need to load it !

$ cat /etc/modules


From: GIPABU at: 2009-11-10 11:04:34

Hi all,

I tried all modes suggested but I'm not able to run correctly my bond conf in mode 0.

Any suggestion?

From: Ulises E. at: 2009-11-06 20:10:40

Hi, I use your advise on Debian Squeeze, that's the only way it work for me, adding the parameters on the /etc/network/interfaces. I wonder why there's no more information related to the drop packages. Best Regards.

From: allan at: 2009-08-30 14:11:29

Just an FYI, on my Lenny box, had to add 'bonding' to /etc/modules

From: at: 2010-11-05 14:15:01


Can i do a bounding with two pppoe ??


Victor Daniel Witoszek Arias

From: Rene Seiler at: 2011-03-25 10:10:59


a couple of days ago I set up Debian Lenny Servers in a new infrastructure which provides redundant LAN and WAN connections. NIC bonding was easy to set up, but NIC bonding and XEN is different. Here's a short summary of things you should do to get your system up and running: