• Setup Linux Network bonding

    Bonding is a creation of a single bonded interface by combining two or more Ethernet interfaces. This helps to increase throughput, and to provide redundancy in case one of the links fails or Ethernet card fails.

    Steps for bonding in Redhat:

    Step 1.

    Create a Bond0 configuration file :

     $ cat /etc/sysconfig/network-scripts/ifcfg-bond0  

    Add the following lines on it :

    DEVICE=bond0
    IPADDR=192.168.0.10
    NETMASK=255.255.255.0
    GATEWAY=192.168.0.1
    USERCTL=no
    BOOTPROTO=none
    ONBOOT=yes

    Step 2.

    Edit the file /etc/modprobe.d/bonding.conf and add the following line to Load bond driver/module

    alias bond0 bonding

    Then load the module kernel:

    modprobe bonding

    Step 3.

    Modify Ethernet interfaces configuration :

    $ cat /etc/sysconfig/network-scripts/ifcfg-eth0 


    Add the following lines on it :


    DEVICE=eth0
    BOOTPROTO=none
    ONBOOT=yes
    # Settings for Bond
    MASTER=bond0
    SLAVE=yes

     $ cat /etc/sysconfig/network-scripts/ifcfg-eth1  

    Add the following lines on it :


    DEVICE=eth1
    BOOTPROTO=none
    ONBOOT=yes
    USERCTL=no
    # Settings for bonding
    MASTER=bond0
    SLAVE=yes

    Step 4.

    Set bond0 bonding kernel module parameters :

    • mode=0 (Balance Round Robin)
    • mode=1 (Active backup)
    • mode=2 (Balance XOR)
    • mode=3 (Broadcast)
    • mode=4 (802.3ad)
    • mode=5 (Balance TLB)
    • mode=6 (Balance ALB)

    Add the following lines to /etc/modprobe.conf

    # bonding commands
    alias bond0 bonding
    options bond0 mode=1 miimon=100

    Step 5.

    Restart the network services.

     $ service network restart

    After network service started ,check the proc settings.

     $ cat /proc/net/bonding/bond0 

    Also ,check that bond0 interface is active :

    ifconfig -a
    

    Categories: Linux, Network

    Comments are currently closed.