X
    Categories: LinuxNews

How To Configure Network Bonding on Debian

debian-logo

Bonding

This article will show how to “bond” two Ethernet connections together to create an auto failover interface.

Installation

First install the ifenslave-2.6 package, necessary to enable bonding:

apt-get install ifenslave-2.6

Shutdown / Unconfigure Existing Interfaces

# ifdown eth0 (Repeat for all interfaces included in the bond)
# /etc/init.d/networking stop

Configuration

Modify the /etc/network/interfaces file:

auto bond0

iface bond0 inet static
    address 10.31.1.5
    netmask 255.255.255.0
    network 10.31.1.0
    gateway 10.31.1.254
    slaves eth0 eth1
    bond-mode active-backup
    bond-miimon 100
    bond-downdelay 200
    bond-updelay 200

Additional Note For Debian Lenny On Sparc

(may be applicable on other architectures as well)

# cd /etc/modprobe.d

# cat > aliases-bond.conf
alias bond0 bonding
  options bonding mode=1 arp_interval=2000 arp_ip_target=192.168.3.1
<CTRL-D>

Without this file, you will get a warning when starting up the bonded interface similar to this:

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.

Startup / Configure New Interfaces

# ifup bond0
# /etc/init.d/networking start

And more, if you use a Lenny environment which has been upgraded from Etch, it is strongly recommended to check the result of the following command to check the bonding device mode, because configuration files for Etch and older versions do not work for Lenny and later releases.

cat /sys/class/net/bond0/bonding/mode
Pedro :