
After some trial and error, I got the trunking working between my Debian Squeeze installation and the switch with LACP support. Here’s the config to make it work:
You should only need to configure one file and install one package to make everything work on the Linux side.
The config file: /etc/network/interfaces
The package: ifenslave
Here’s my configuration with 4 interfaces. Adjust for your address, interface names, and desired bond mode.
auto bond0
allow-hotplug bond0
iface bond0 inet static
address 192.168.5.5
netmask 255.255.0.0
network 192.168.0.0
gateway 192.168.1.1
slaves eth0 eth1 eth2 eth3
bond-mode 802.3ad
bond-miimon 100
bond-downdelay 200
bond-updelay 200
pre-up ifconfig eth0 up
pre-up ifconfig eth1 up
pre-up ifconfig eth2 up
pre-up ifconfig eth3 up
If you don’t have a switch to handle trunking in this way, you can use one of the other bonding modes and still get high bandwidth and/or fault tolerance.
To do all of this manually just to try it out, do the following:
# modprobe bonding mode=4 miimon=100 # ifconfig bond0 192.168.5.5 netmask 255.255.0.0 broadcast 192.168.255.255 # ifenslave bond0 eth0 eth1 eth2 eth3 eth4 # route add default gw 192.168.1.1
# dmesg | grep bonding.txt
bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.
alias bond0 bonding alias bond1 bonding options bonding mode=802.3ad miimon=100 downdelay=200 updelay=200 max_bonds=2