How to configure Ethernet Bonding with LACP on Debian Lenny Linux

10GoE is still pricey. But you can get a 4Gbps connection inexpensively!

Quick update: I built a Debian Squeeze box recently and the same steps worked for me, initially. But problems developed afterwards. Specifically, net-agent (snmp) would take up more and more CPU over time. A “process leak”, if you will. After months of monitoring and diagnostics we found a solution which involves a different NIC configuration.

So you need a fat network connection on your Debian 5 server, but a 10 GoE infrastructure is not in your budget? No fear! Link Aggregation Control Protocolis here to save the day!

This was both the problem I had, and the solution I learned to implement thanks to a question posted on serverfault.com (Multiplexed 1 Gbps Ethernet?) and some hours of research & experimentation.

Here’s what I did:

  • Purchase a NIC capable of LACP with solid Linux driver support. I went with an Intel PRO/1000 PT Quad Port Server Adapter.
  • Purchase a Switch capable of LACP. It should be more than capable of handeling the bandwidth. We opted for an HP ProCurve 2510G-24.
  • Install ifenslave-2.6: apt-get install ifenslave-2.6
  • Purchase some network cables. Cat 6 if you can, Cat 5e if not.
  • Edit /etc/modules and add bonding mode=4 miimon=100 max_bonds=2. This will load the module at boot time in the future. The value of max_bonds is the number of bonding devices your system will have. The default is 1.
  • Load the module, so we can proceed. modprobe bonding. There should be no errors. Confirm it is loaded with modprobe -l | grep bond
  • Edit /etc/network/interfaces to look something like this:
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    auto  bond0
    iface bond0 inet static
        address     192.168.1.131
        gateway     192.168.1.1
        broadcast   192.168.1.255
        netmask     255.255.255.0
        up   /sbin/ifenslave    bond0 eth0 eth1 eth2 eth3
        down /sbin/ifenslave -d bond0 eth0 eth1 eth2 eth3
    
    #similar configuration for bond1
    
  • Add to /etc/modprobe.d/arch/X86_64.conf something like this for a 64-bit installation:
    
    alias bond0 bonding
    alias bond1 bonding
    
  • Plug in the network cables

  • Restart the network: /etc/init.d/network restart
  • Configure the switch to use the four ports as a single trunk. Here’s how for an HP ProCurve:

  • Confirm that there are no errors
    1. The NIC and switch LEDs should be active
    2. dmesg will show what the kernal thinks of your new configuration
    3. ifconfig should show your bond0 interface up
    4. The interface should be pingable both internally and from other computer

You should be good to go at this point!