NIC Bonding On Debian Lenny

Want to support HowtoForge? Become a subscriber!
 
Submitted by AccessForbidden (Contact Author) (Forums) on Mon, 2009-03-02 17:51. :: Debian

NIC Bonding On Debian Lenny

Ethernet bonding refers to aggregating multiple ethernet channels together to form a single channel. This is primarily used for redundancy in ethernet paths or for load balancing. This page refers in particular to performing ethernet bonding under Linux, and so does not limit itself to discussion of 802.3ad Trunk Aggregation.

 

Ethernet Bonding Types

The Linux kernel bonding module supports a number of bonding types.

mode=0 (balance-rr)
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

mode=1 (active-backup) 

One slave interface is active at any time. If one interface fails, another interface takes over the MAC address and becomes the active interface. Provides fault tolerance only. Doesn’t require special switch support

mode=2 (balance-xor) 

Tranmissions are balanced across the slave interfaces based on ((source MAC) XOR (dest MAC)) modula slave count. The same slave is selected for each destination MAC. Provides load balancing and fault tolerance.

mode=3 (broadcast) 

Transmits everything on all slave interfaces. Provides fault tolerance.

mode=4 (802.3ad) 

This is classic IEEE 802.3ad Dynamic link aggregation. This requires 802.3ad support in the switch and driver support for retrieving the speed and duplex of each slave.

mode=5 (balance-tlb) 

Adaptive Transmit Load Balancing. Incoming traffic is received on the active slave only, outgoing traffic is distributed according to the current load on each slave. Doesn’t require special switch support

mode=6 (balance-alb) 

Adaptive Load Balancing - provides both transmit load balancing (TLB) and receive load balancing for IPv4 via ARP negotiation. Doesn’t require special switch support, but does require the ability to change the MAC address of a device while it is open.

 

Set Up Bonding Ethernet on Debian

To use Bonding Ethernet for High-Availability (fail-over) on Debian Lenny you need to:

Install package ifenslave-2.6. To install this package follow this command:

#apt-get install ifenslave-2.6

Make sure the real NICs kernel modules are loaded automatically.

Edit /etc/network/interfaces to look like this:

iface bond0 inet static
address 10.0.1.5
netmask 255.255.255.0
network 10.0.1.0
gateway 10.0.1.254
up /sbin/ifenslave bond0 eth0 eth1
down /sbin/ifenslave -d bond0 eth0 eth1

Comment or borrow the lines referring to your real NICs in the same file.

Add the following lines to your /etc/modprobe.d/arch/i386:

alias bond0 bonding
options bonding mode=5 miimon=100 downdelay=200 updelay=200

Make sure you change your mode!

Then restart your networking:

#/etc/init.d/networking restart


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Rene Seiler (not registered) on Fri, 2011-03-25 11:10.
Hi,

a couple of days ago I set up Debian Lenny Servers in a new infrastructure which provides redundant LAN and WAN connections. NIC bonding was easy to set up, but NIC bonding and XEN is different. Here's a short summary of things you should do to get your system up and running: http://www.9126consulting.com/2011/03/17/nic-bonding-on-xen-hosts/
Submitted by witoszek (registered user) on Fri, 2010-11-05 15:15.

Hello

Can i do a bounding with two pppoe ??

Thanks

Victor Daniel Witoszek Arias

Submitted by allan (not registered) on Sun, 2009-08-30 15:11.
Just an FYI, on my Lenny box, had to add 'bonding' to /etc/modules
Submitted by fishtenors (registered user) on Tue, 2009-04-21 21:36.

Before running:

/etc/init.d/networking restart

Make sure to shutdown each of your slave interfaces using ifconfig (ifup will not work, as it refers to /etc/network/interfaces for interface config info which won't be there any more).

ifconfig eth0 down
ifconfig eth1 down

etc. Then run:

ifup bond0
/etc/init.d/networking restart

You should be golden! Special thanks to:

http://anothersysadmin.wordpress.com/tag/debian-bonding-networking-ethernet/

Submitted by Anonymous (not registered) on Tue, 2009-03-17 13:25.

On debian you don't need to use up/down lines nor /etc/modprobe.d things. just configure bond intreface this way:

 iface bond0 inet static
        address 10.0.1.5
        netmask 255.255.255.0
        network 10.0.1.0
        gateway 10.0.1.254
        bond_mode balance-tlb
        bond_miimon 100
        bond_downdelay 200
        bond_updelay 200
        slaves eth0 eth1

Submitted by Ulises E. (not registered) on Fri, 2009-11-06 21:10.
Hi, I use your advise on Debian Squeeze, that's the only way it work for me, adding the parameters on the /etc/network/interfaces. I wonder why there's no more information related to the drop packages. Best Regards.
Submitted by GIPABU (not registered) on Tue, 2009-11-10 12:04.

Hi all,

I tried all modes suggested but I'm not able to run correctly my bond conf in mode 0.

Any suggestion?

Submitted by AccessForbidden (registered user) on Thu, 2009-03-19 11:40.
Many men many minds. In my opinion it's easier to use modprobe
Submitted by Anonymous (not registered) on Fri, 2009-03-20 21:37.
right but using the interface file for the full configuration is a much better way to do it because its modular and you don't have the configuration spread across multiple files.  Its also the way the README file in the package explains.  Why even bother updating the howto for lenny if its not going to be done any differently than previous releases?
Submitted by surlyjake (registered user) on Sun, 2009-03-15 15:07.

dont forget about round robin mode.

mode=0 (balance-rr)
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

http://www.linuxhorizon.ro/bonding.html

Submitted by AccessForbidden (registered user) on Mon, 2009-03-16 23:41.
Thanks for fixing!
Submitted by Anonymous (not registered) on Wed, 2009-03-11 11:56.

Note that on debian lenny mii is a kernel module.
$ grep CONFIG_MII /boot/config-2.6.26-1*
CONFIG_MII=m
So you need to load it !
$ cat /etc/modules
mii

Submitted by Anonymous (not registered) on Thu, 2009-03-05 09:04.

It might be smart (and nice) to combine the up lines into a single statement:

 up ifenslave bond0 eth0 eth1 eth2 eth3 <etc>

 and also to clean up after oneself on shutdown:

 down ifenslave -d bond0 eth0 eth1 eth2 eth3 <etc>