Hi all,

I am wondering if someone knows how to configure nic bonding under Slackware 12.1. I am setting up a HA NFS Server and the last thing I want to do is nic bonding. I found this instructions and followed the as far as possible but there is a change in SLackware 12.1 that has not been in Slackware 12. The init script rc.inet1 has changed.

I followed this steps: (Institut für Pervasive Computing)

Network device bonding
Aggregating multiple network links into a single link, using a variety of methods. Before we can start to configure we have to build as a binary:
cd /usr/src/linux/Documentation/networking
gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave
cp ifenslave /sbin/ifenslave

We need the kernel module bonding and the module for our network card in our case tg3. Now we can create a init script which make a bond device for our two GBit NICs, we place them under "/etc/rc.d/rc.bond":
#!/bin/sh
#
case "$1" in
'start')
echo "start bond0"
#modprobe bonding mode=balance-alb miimon=100
modprobe bonding mode=balance-rr miimon=100
modprobe tg3
ifconfig bond0 up
ifenslave bond0 eth0
ifenslave bond0 eth1
#TODO need to be changed
ifconfig bond0 hw ether 00:16:3e:aa:aa:aa
;;
'stop')
ifconfig bond0 down
rmmod bonding
rmmod tg3
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac

The different kinds of bonding methods we can add as parameter to the bonding module. More under [Bonding wiki website]. Attention for the MAC Address! If we do not use the "hw ether" parameter the MAC Address will be automatically take from the first network card. We use the static method because we got problems with the Xen Bridge when we used the dynamic mode.

UPDATE: Bonding
We have to change the bonding mode otherwise we run into ARP network problems with the xen bridge. More about the the problem you can find [here]. The solution is disable the bonding or (i tried) use mode=1 (active-backup). But this is only a fault tolerance mode.

That we can use the standard network configuration files under slackware we add the following into "/etc/rc.d/rc.M" but before "rc.inet1" call:
..
# NEW START
# dominik say start bonding first
if [ -x /etc/rc.d/rc.bond ]; then
. /etc/rc.d/rc.bond start
fi
# NEW END

# Initialize the networking hardware.
if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1
fi
..

To configure our bond device we use the "/etc/rc.d/rc.inet1.conf" file:
# Bond
IFNAME[4]="bond0"
IPADDR[4]="XXX.XX.XX.XX"
NETMASK[4]="255.255.255.0"
USE_DHCP[4]=""
DHCP_HOSTNAME[4]=""

# Default gateway IP address:
GATEWAY="XXX.XX.XX.XX"

To get the status of the bond device use the following command:
cat /proc/net/bonding/bond0

result:
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:e0:81:5e:9e:c4

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:e0:81:5e:9e:c5

I put everything in place except the changes in rc.inet1.
Does someone know a better way to configure nic bonding?

Thanks