Bonding allows to aggregate two or more network interface cards into one virtual device with aggregated bandwith. It also adds the possibillity to implement failover of the members of the newly created bond-device. We use ethernet bonding for our iSCSI-SAN servers with DRBD-replication and for our Xen hosts (dom0-nodes).
The default kernel in Debian Lenny (and Debian Etch) has support for ethernet bonding. In addition to kernel support you also need a userland tool.
apt-get install ifenslave-2.6
Add the kernelmodule for bonding to the list of modules to load on system boot. /etc/modules
... bonding ...
We choose 'mode 0' as the bonding mode so add these options to /etc/modprobe.d/bonding
options bonding mode=0 miimon=100
Restart the node or manually load the kernelmodule with the required options.
modprobe bonding mode=0 miimon=100
More information on the available bonding modes and linux bonding in general is available at: http://linux-ip.net/html/ether-bonding.html
First create the bond-device, add IP-properties to it and then add its member interfaces. You can also add additional interfaces while the bond is online! Just in case: the 'ip' command is in the Debian package 'iproute'.
ip link set dev bond0 addr 00:80:c8:ce:00:54 ip addr add 192.168.1.240/24 brd + dev bond0 ip link set dev bond0 up sleep 2 /sbin/ifenslave-2.6 bond0 eth0 eth1
Check the result
ip link show bond0