NIC bonding (aka NIC teaming) with Debian Lenny

In order to move our Nagios installation from a virtual server to a dedicated hardware machine i installed Debian Lenny on a HP Proliant DL 380 G5. This server has two integrated NICs which can easily be used together as a network bond. So if one way to or from the server failes, the machine is still available through the other card.

All the necessary requirements such as the bonding module and stuff are available in the debain standard kernel (the time i wrote this: 2.6.26-2-amd64)

What’s still left to do is to install the ifenslave package:

 apt-get install ifenslave-2.6

and to modify some configuration files
/etc/modprobe.d/arch/i386 or /etc/modprobe.d/arch/i386 (depending on your architecture):

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

Mode 1 (also called: active-backup) means, that only one interface is active. The other one comes only into play, when the first (active) card fails. So this mode is only for fault tolerance and not for loadbalancing, but the configuration of this mode is very simple, because it doesn’t require additional switch configuration.

Edit /etc/network/interfaces and configure the bond0 interface:

auto bond0
iface bond0 inet static
   address 10.10.0.25
   netmask 255.255.255.0
   gateway 10.10.0.1
   up /sbin/ifenslave bond0 eth0 eth1
   down /sbin/ifenslave -d bond0 eth0 eth1

Don’t configure any additional network settings for eth0 and eth1!

For testing purposes you can now load the bonding module (will also be done automatically when the servers boots):

modprobe bonding

and restart your network:

/etc/init.d/networking restart

Now you should be able to ping the server from another host and plug/unplug the cables of the two integrated NICs while the server always answers the ping requests.

This entry was written by Thorsten , posted on Monday October 05 2009at 03:10 pm , filed under Uncategorized and tagged , . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

3 Responses to “NIC bonding (aka NIC teaming) with Debian Lenny”

  • Magnus says:

    Hi, great blog.
    Im experiencing alot of packetloss when im using mode 0.
    Anyone else experience that?
    I have not tried other modes becouse 0 is the only one im interested in.

    Im using 2.6.26 kernel and have e1000e nic/drivers.

    Kind Regards
    Magnus

  • Thorsten says:

    Hi Magnus,

    thanks for your feedback.
    When using mode 0 or balance-rr the two nics must be connected to the same switch and the appropriate ports on the switch must be configured as a trunk. Is that the case in your setup?

    I’m using Broadcom BCM5704 nics with mode 1 and it works very well without additional switch-configuration.

    /schmalenegger

  • Miltin says:

    Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantastic lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates. Really fantastic and I will be coming back for more information at your site and revisit it! Thank you. HP ProLiant DL360 G5

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>