[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I have made network bonding work.



At last, I have made network bonding work.

1, compile ifenslave from linux kernel
 # gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave
 # cp ifenslave /sbin/ifenslave

2, add these lines to /etc/modprobe.d/modprobe.conf to load bonding
module
 alias bond0 bonding
 options bond0 mode=0 miimon=100

3, add these lines to /etc/sysconfig/network-scripts/ifup-eth, just
before
"# Check the interface parameters."

#
*****************************************************************************
# Check if enabled?
#
*****************************************************************************
if [[ x"${ENABLE}" = x"no" ]]; then
        echo -e $"$1 is disabled"
        exit 1
fi

#
*****************************************************************************
# Check if slave?
#
*****************************************************************************
if [[ x"${SLAVE}" = x"yes" && x"${MASTER}" != x"" ]]; then
        ifconfig  $1 down
        ifenslave "${MASTER}"  $1
        exit 1
fi

4, copy ifcfg-eth0 to ifcfg-bond0, copy ifup-eth0 to ifup-bond0,
ifdown-eth0 to ifdown-bond0 and change its contents from "eth0" to
"bond0"

5, change ifcfg-eth0 and ifcfg-eth1 to make it slave.
$ cat ifcfg-eth0
ENABLE=yes
NAME=Ethernet
MASTER=bond0
SLAVE=yes

$ cat ifcfg-eth1
ENABLE=yes
NAME=Ethernet
MASTER=bond0
SLAVE=yes

restart the system, and check using ifconfig.