Linux bonding

Problem: We have two switch HP procurve 5300 configured with Spanning tree and some Debian server (and a Debian firewall) where we want High Availability using two network interfaces. In every server we want eth0 to be the primary device (it is plugged in the primary switch).

Possible Solution: First of all take a look at the file
/usr/src/linux/Documentation/networking/bonding.txt
in the kernel distribution.

Then add to /etc/modutils/aliases the two lines
alias   bond0  bonding
options bond0  miimon=100 mode=1 primary=eth0
and recreate /etc/modules.conf with update-modules.

If it does not work try adding the previous lines also to /etc/modprobe.d/aliases. Debian Sarge is not very clear on where to put aliases and options for kernel modules :-(.

This is how we configure /etc/network/interfaces:

auto lo
iface lo inet loopback

auto bond0
iface bond0 inet static
    address   192.168.1.19
    network   192.168.1.0
    netmask   255.255.255.0
    broadcast 192.168.1.255
    gateway   192.168.1.254
    up        /sbin/ifenslave bond0 eth0 eth1
(we use the package ifenslave-2.6).
This is the output of ifconfig:
			
bond0     Link encap:Ethernet  HWaddr 00:10:5A:67:0B:53
          inet addr:192.168.1.19  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:22169 errors:0 dropped:0 overruns:0 frame:0
          TX packets:275 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1742016 (1.6 MiB)  TX bytes:55344 (54.0 KiB)

eth0      Link encap:Ethernet  HWaddr 00:10:5A:67:0B:53
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:11270 errors:0 dropped:0 overruns:0 frame:0
          TX packets:275 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:887220 (866.4 KiB)  TX bytes:55344 (54.0 KiB)
          Interrupt:11 Base address:0xdc00

eth1      Link encap:Ethernet  HWaddr 00:10:5A:67:0B:53
          UP BROADCAST RUNNING NOARP SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:10899 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:854796 (834.7 KiB)  TX bytes:0 (0.0 b)
          Interrupt:10 Base address:0xe000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

eth1 is not active because of the NOARP value.
This is how /proc/net/bonding/bond0 looks like:
Ethernet Channel Bonding Driver: v2.6.0 (January 14, 2004)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:10:5a:67:0b:53

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:50:04:e8:a4:49

home