Bonding Network Interfaces in Debian (Lenny)

Bonding multiple NICs in Linux is often useful for performance and redundancy.

Installing the Required Tools

There are a few userland applications we'll need for this exercise. Install them in the typical Debian fashion (as root):

aptitude install ifenslave ifenslave-2.6 ethtool

Adding the Necessary Kernel Modules

In order for bonding to work, you'll also need a couple of modules. You can load them like so:

modprobe bonding mii

…and set them to load automatically in the future as follows:

echo "modprobe" >> /etc/modules
echo "mii" >> /etc/modules

Configuring the Bonded Interface(s)

All that's left to do is create one or more bonded interfaces for your system to use. First, take down any interfaces which are to be bonded. For instance:

ifdown eth0 eth1

In /etc/network/interfaces, you would comment out or remove any existing entries for the interfaces you plan to bond, then create an entry for each virtual 'bond' device. For example:

auto bond0
allow-hotplug bond0
iface bond0 inet static
        address 10.0.0.250
        netmask 255.255.0.0
        network 10.0.0.0
        broadcast 10.0.255.255
        gateway 10.0.0.1
        bond_mode balance-tlb
        bond_miimon 100
        bond_downdelay 200
        bond_updelay 200
        slaves eth0 eth1

Of course, one would replace all of the IP and routing information detailed above with the correct ones for your own environment. As you can also see there are many options to be tweaked, including different load-balancing methods, though the bonding settings outlined above should be acceptable for most environments. When you are happy with your settings, you can bring up your new bonded interface(s):

ifup bond0

For detailed info on the myriad of options for the bonding driver, see here.

debian/bonding_network_interfaces.txt · Last modified: 2012/01/22 17:32 (external edit)
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported
This server powered by Debian Linux Valid CSS Driven by DokuWiki This site works best with Firefox Recent changes RSS feed Valid XHTML 1.0