NIC Bonding/Teaming - Debian Sarge


You can find an easier to read version here:

The concept of NIC Bonding (or sometimes called NIC Teaming) is that you have two NICs bonded together to appear as if they are the same physical device. I.e. They will both present the same Hardware (MAC) address. This is accomplished through the ifenslave utility, which enables the kernel to see/use only one device, while it sends out packtes via the two slave devices using a round-robbin scheduler.

System: Debian Sarge 3.1 (vanilla kernel
Modules Involved: bonding, mii, nic_module (e100 in this example)
Utilities: ifenslave, mii-tool


Before attempting to bond two NICs, it is highly recommended that you verify the integrity and functionality of each NIC on its own. This document assumes that you've already done that. Using 'mii-tool' you should see something like the following:

testbox:/# mii-tool
eth0: negotiated 100baseTx-FD, link ok
eth1: negotiated 100baseTx-FD, link ok

In order for this to work, the kernel must have support for bonding
devices. A few ways to check would be:

testbox:/# modprobe --list | grep bonding/lib/modules/
testbox:/# cat /boot/config- | grep -i bonding

We use the mii-tool (mii.o module) to monitor the interfaces for
failover... though, as most ethernet adapters use an MII (Media
Independant Interface) to autonegotiate link speeds, its pretty standard
that you'd have this.

testbox:/# cat /boot/config- | grep -i mii# CONFIG_MPENTIUMII is not set

testbox:/# modprobe --list | grep -i mii

Second, your going to need to install the ifenslave utility.

testbox:/# apt-get update && apt-get install ifenslave
.......... removed standard output (nothing interesting)

Theres no configuration here, so that is that. Now we are ready for
the configuration files.

Configuration Files:

There are many different variations of this, but for now... this is how I did it to get it working.

vi /etc/modutils/aliases and add/edit the following:

alias bond0 bonding
alias eth0 e100
alias eth1 e100
options bonding mode=0 miimon=100

vi /etc/modutils/actions and add/edit the following:

probeall bond0 eth0 eth1 bonding

After editing the modprobe config files you need to run the command:

testbox# update-modules

vi /etc/network/interfaces and add/edit the following:

auto bond0
iface bond0 inet static
hwaddress ether 00:02:B3:48:50:2C
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1

You do NOT set up entries for 'eth0' or 'eth1' outside of whats listed above under the 'bond0' entry. Bond0 will now be the interface that the kernel works with. running an 'ifconfig' will show all three interface (bond0,eth0,eth1), all with the same MAC and IP addresses.

And thats basically it. Now, all you should need to do is load the 'bonding' module and stop/start networking... and the apropriate modules should load automagically:

testbox:/# modprobe bonding
testbox:/# /etc/init.d/networking stoptestbox:/# /etc/init.d/networking start

You might have to play around with this part for a bit. For me I had to manually ifconfig up the bond0 device:

testbox:/# ifconfig bond0 netmask up

Assuming that there were no errors, you should be able to test this out. Try and ping your IP address from another box. You'll notice both NICs responding to the ping requests back and forth (round robin). If you unplug eth0, you'll get an error the console the "eth0 has failed, eth1 becoming primary" or something like that (and visa versa if you unplug eth1). But you shouldn't drop any of the ping requests (or no more than a few), as it now has a redundant network connection.

In a higher end environment, you could plug each NIC into a separate switch (staying on the same VLAN) and further improve your high availability config... and so on and so forth.

BJ Dierkes, RHCE4-LPIC1
wdierkes [at] 5dollarwhitebox [dot] org
Texas, USA


Debian GNU/Linux:

Share this page:

12 Comment(s)

Add comment


From: Anonymous at: 2005-11-04 04:36:06

Can I connect each of 2 NICs to 2 ethernet switches? Should be concerned or not?

From: Anonymous at: 2005-11-04 12:46:06

The ultimate goal of NIC teaming is limiting a "Single Point of Failure"... so Yes, you would *want* to plug each nic into a different switch if possible. However, the switches (or ports) would need to be part of the same VLAN.

From: Anonymous at: 2005-11-07 00:27:31

Many thanks :)

From: Anonymous at: 2006-03-28 09:00:00

Success full used on fedora core 4

if u use cisco switches make sure you enable spanning tree if not both nic become active en your network speed will be reduced

From: Anonymous at: 2005-11-18 18:59:21

I'm attempting this on a debian etch machine, the only difference being that I have two different NICs in this machine. I followed the directions, substituting my drivers in /etc/modutils/aliases in place of the eepro100, but when I restart the networking and try to bring up bond0, I get:

SIOCSIFHWADDR: No such device

Failed to bring up bond0

I'm wondering if my hwaddress line is the problem; what MAC address should I use for it? One of the two NICs, or a different one?

From: Anonymous at: 2005-11-23 02:03:11

I'm having precisely the same problem and have been working on this for many hours. Did you have any luck resolving this?

I am running Debian 2.6.8-2-686. The ethernet nics are dual Broadcom BCM5721's and as a test I installed their bcm5700 drivers - to no avail.

Any help would be much appreciated - I would love to get this working. Thanks.

From: Anonymous at: 2005-11-25 02:07:52

Although I believe that the hwaddress entry in /etc/network/interfaces is optional for bonding, adding it with the MAC of either NIC (or even an arbitrary MAC) continues to result in this error for me:

Configuring network interfaces...SIOCSIFHWADDR: No such device

Failed to bring up bond0

Removing the hwaddress entry in /etc/network/interfaces altogether results in several errors:

Configuring network interfaces...SIOCSIFADDR: No such device

bond0: ERROR while getting interface flags: No such device

SIOCSIFNETMASK: No such device

SIOCSIFBRDADDR: No such device

bond0: ERROR while getting interface flags: No such device

bond0: ERROR while getting interface flags: No such device

Failed to bring up bond0

Thanks for the otherwise great tutorial. If I could read the source I would ;-) Any help much appreciated.

Thanks, KB

From: admin at: 2005-11-25 09:08:23

Please do not use the comment function to ask for help! If you need help, please use our forum:

From: at: 2007-07-08 14:44:58

1. apt-get install modutils

2. Add in /etc/modprobe.d/aliases and /etc/modutils/aliases

alias bond0 bonding
alias eth0 e100
alias eth1 e100
options bonding mode=2 miimon=100

(I chose mode2 for load balancing instead of round robin nics with mode 0)

3.During debian installation I choosed eth1 as default nic, this implies that in the ifenslave command eth1 come first and eth0 after. My interfaces file is

# The primary network interface
allow-hotplug eth0
allow-hotplug eth1
#iface eth1 inet static
auto bond0
iface bond0 inet static
pre-up ifconfig bond0 up
pre-up ifconfig eth1 up
pre-up ifconfig eth0 up
#hwaddress ether 00:14:C6:33:5D:81
up ifenslave bond0 eth1 eth0
down ifconfig eth1 down
down ifconfig eth0 down
down ifenslave -d bond0 eth1 eth0

(I added  down commands since /etc/init.d/networking stop hanged completelly my box)

That's all

From: themachine at: 2005-11-23 06:00:20

I believe that I used the MAC address of eth0. Please let me know if it works for you.

BJ Dierkes, RHCE4 - LPIC1
wdierkes [at] 5dollarwhitebox [dot] org
Texas, USA

From: Anonymous at: 2006-07-26 00:27:02

I used this method sucessfully to configure a dual port Intel Pro 100 Server Adapter on Ubuntu 6.06 with one exception. The modifications to /etc/modutils/aliases needed to be made to /etc/modprobe.d/aliases instead.

From: at: 2007-07-26 13:13:48


after reading nearly every article on bonding I felt compelled to add this to the mix.  On RH Enterprise version 4(update 5) i could not get mode 1 bonding working.  it kept using load balancing round robin and as I had both nics connected to different switches in a redundent network topology it was causing duplicate packets which was causing delays when opening web pages on the apaches.

anyway below is the recommended config and the actual working config I hope it saves someone time in the future......


Bonding Issue
Recommended documented config

alias bond0 bonding

install bond0 /sbin/modprobe bonding -o bond0 mode=1 miimon=100

alias eth0 bnx2

alias eth1 bnx2

alias eth2 e1000

alias scsi_hostadapter megaraid_sas

alias scsi_hostadapter1 ata_piix

alias usb-controller ehci-hcd

alias usb-controller1 uhci-hcd

Actual working config
#alias bond0 bonding

install bond0 /sbin/modprobe bonding -o bond0 mode=1 miimon=100 primary=eth0

alias eth0 bnx2

alias eth1 bnx2

alias eth2 e1000

alias scsi_hostadapter megaraid_sas

alias scsi_hostadapter1 ata_piix

alias usb-controller ehci-hcd

alias usb-controller1 uhci-hcd