HOWTO: Ethernet bonding in Debian Lenny

In an older post I explained how to create a bond interface in Debian Etch… now, this doesn’t work anymore due to some changes in Lenny.

So, long story short, first of all, install ifenslave

# apt-get install ifenslave-2.6

edit /etc/network/interfaces and add the bond0 config:

auto bond0
iface bond0 inet static
# dns-* options are implemented by the resolvconf package, if installed
up /sbin/ifenslave bond0 eth0 eth1
down /sbin/ifenslave -d bond0 eth0 eth1

now edit /etc/modprobe.d/arch/x86_64 (change the filename depending on your architecture) and add these lines

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

Brief explanation:

  • miimon N: check if the active interface(s) is alive every N milliseconds
  • downdelay N: wait N milliseconds after a detected link failure to consider the link down
  • updelay N: wait N milliseconds after a detected link restoration to consider the link up
  • mode N: 1 means master/slave configuration, so there’s only one active master. If this link fails, then slave is used.

For a more complete description of all the possible parameters, refer to Linux Documentation/networking/bonding.txt

After this, you can restart networking or reboot if you are working remotely and it should work without a problem. It did for me :)


5 thoughts on “HOWTO: Ethernet bonding in Debian Lenny

  1. So, we followed these instructions on a new install of Lenny. Upon reboot, the system hangs on Starting NFS common utilities: statd. After a few minutes, it reads failed! and continues rebooting eventually failing the mysqld start up and a cople of other processes. It eventually returns to Starting NFS common utilities: statd where it sits for another few minutes, and eventually starts up to login. After login in, i have no internet access. It doesn’t seem like the bonding worked and I have not been able to find anything worth while on the issue. Do you have any input?

  2. To Clay,

    I had to apt-get remove network-manager, some nics (that were part of bonding) got an ip from dhcp while bonding was working, causing network failures. If no internet, check that you have a default route to your gateway (me: eth0 = to adsl box / bond0 (eth1+eth2+eth3+eth4) = internal if for lan)
    Routes should be configured automatically with a correct /etc/network/interfaces

    >route -n

    Table de routage IP du noyau
    Destination Passerelle Genmask Indic Metric Ref Use Iface U 0 0 0 bond0 U 0 0 0 eth0 UG 0 0 0 eth0

  3. Urland,
    Thanks for your reply. After removing network-manager, we now have internet on this box and that is all working. However it seems like every time that we bond the nics, “NFS common utilities: statd” fails, then our MySQL database server fails as well.

    Any idea why these are failing JUST when we enable NIC bonding?


  4. I did followed these instructions and I’m having some problems trying to get bonding and fault tolerant modes working. Not all modes work and those that work do not work as xpected for ei, if i remove one of the internet lines off the machine stops providing internet.

    Now, do both slave lines have to be under the same ip range network ? even if they are two different modems?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s