NIC teaming on Debian Etch and Lenny

There are plenty of HOWTOs on so called NIC teaming or NIC bonding for Debian, but of the ones I’ve seen, they’ve all missed some rather important bits.

Below is the method I personally found to work reliably:

apt-get install ifenslave
echo "bonding" >> /etc/modules
modprobe bonding
ifdown eth0

edit /etc/network/interfaces, changing “eth0” (or your configured NIC) to “bond0”, and replacing “allow-hotplug” with “auto”.  The following sed line give you this automagically:

sed 's/eth0/bond0/;s/allow-hotplug bond0/auto bond0/' </etc/network/interfaces

Tell ifup and ifdown to add/remove devices to bond0 lines:

echo " up /sbin/ifenslave      bond0 eth0 eth1" >> /etc/network/interfaces
echo " down /sbin/ifenslave -d bond0 eth0 eth1" >> /etc/network/interfaces
ifup bond0;

And you’re done!

You can add all the options for the bonding module to the line in /etc/modules, like:

echo "bonding mode=1 miimon=250 primary=eth0" >> /etc/modules;

Details of all options available at linuxfoundation.org

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.