Monday, February 28, 2011

Linux Failover Bonding

1. Add the below lines to /etc/modprobe.conf
                alias bond0 bonding
                options bond0 mode=1 miimon=100
2. Create bond0 device file, /etc/sysconfig/network-scripts/ifcfg-bond0 with the following content:
                DEVICE=bond0
                BOOTPROTO=none
                ONBOOT=yes
                NETWORK=192.168.122.0
                NETMASK=255.255.255.0
                IPADDR=192.168.122.118
                USERCTL=no
3. Create /etc/sysconfig/network-scripts/ifcfg-eth0 with content:
                DEVICE=eth0
                MASTER=bond0
                SLAVE=yes
                USERCTL=no
                BOOTPROTO=dhcp
                IPV6INIT=yes
                IPV6_AUTOCONF=yes
                ONBOOT=yes
4. Create /etc/sysconfig/network-scripts/ifcfg-eth1 with content:
                DEVICE=eth1
                MASTER=bond0
                SLAVE=yes
                USERCTL=no
                BOOTPROTO=dhcp
                IPV6INIT=yes
                IPV6_AUTOCONF=yes
                ONBOOT=yes
5.[root@localhost ~]# service network restart
6.[root@localhost ~]# cat /proc/net/bonding/bond0
                Ethernet Channel Bonding Driver: v3.2.4 (January 28, 2008)
                Bonding Mode: fault-tolerance (active-backup)
                Primary Slave: None
                Currently Active Slave: eth0
                MII Status: up
7.[root@localhost ~]# ifdown eth0
8.[root@localhost ~]# cat /proc/net/bonding/bond0
                Ethernet Channel Bonding Driver: v3.2.4 (January 28, 2008)
                Bonding Mode: fault-tolerance (active-backup)
                Primary Slave: None
                Currently Active Slave: eth1

No comments:

Post a Comment