NIC Bonding On Slackware 12.1

I was standing in front of a problem while I built a NFS Storage Server. It is necessary for me to have redundancy in every point of view. I solved all redundancy issues I had by using server hardware with redundant power supplies, a Raid 1+ 0 Raid array and two UPS’s one for each power supply. The only thing left in my mind was what about a network failure? Well just use the two Gig NIC’s and hook each of them up to its own switch. Great idea but how do I get them acting as one unit speak one single IP? NIC Bonding was my solution. After a couple of hours researching on the Internet stumbled upon the build in solution by using ifenslave.

Here is how I did it:

In order to get fault tolerance we are going to bond the NICs. We need to compile a little program that will help us doing the bonding. Go to /usr/src/linux/Documentation/networking.

Type in:

  gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave

and copy it over to /sbin by typing in:

  cp ifenslave /sbin/ifenslave

Now change to the directory /etc/rc.d and create



This will be the startup script for the bonding and needs to be executeable.


 chmod 755

Start vi by typing


and enter the following:

        case "$1" in
            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
            ifconfig bond0 down
            rmmod bonding
            rmmod tg3
            echo "Usage: $0 {start|stop}"

To save the file hit <ESC> and type in :wq <enter>.

Now we need to make sure that this script gets started upon boot. Type in

vi rc.M

and scroll down to “#Initialize the networking hardware” and position the cursor in the line before that and hit “a” for insert. Type in the following:

# If script is executeable then start it
if [ -x /etc/rc.d/ ]; then
  . /etc/rc.d/ start

Hit <ESC> and type :wq <enter> to save and quit.

It is time to edit the last script. Type

vi rc.inet1.conf

and make sure the NICs have no static IPs assigned or configured for DHCP. It should look like this:



And add these lines to it before the default gateway gets assigned:


Hit <ESC> and type :wq <enter> to write and quit. Reboot your system and after it’s back up login; type in:

cat /proc/net/bonding/bond0

and you should see something similar like this:

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

If the link status is up and your system is responding on pings everything should be fine. You can also monitor the Link Status with

mii-tool –w

It gives you live status of the link.

Share this page:

6 Comment(s)