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.

Beteilige dich an der Unterhaltung

2 Kommentare

  1. 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

  2. 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

Schreib einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.