Home > LiNuX (based on debian), Networking, Trouble-Shooting > RedHat Linux network redundancy using interface bonding

RedHat Linux network redundancy using interface bonding

This notes written down when facing requirement to make barco wall-display working with redundant network link. Eventhough setup barco controller is not part of my responsibility, I still want to help our customer to fulfill their needs – for the sake of knowledge sharing.

Specification

This configuration tested using hardware and software specification

  1. Linux distribution RH7.2 (Enigma) i386
  2. network interfaces (identified as eth0 & eth1)

Configuration Step

  1. Load kernel module named bonding
  2. [root@barco root]# modprobe bonding

  3. Automatic load bonding module on startup, add this lines to file /etc/modules.conf
  4. [root@barco root]# vi /etc/modules.conf
    # LQman add for bonding purpose
    alias bond0 bonding

  5. create interface bond0 as MASTER interface using Round Robin mode
  6. [root@barco root]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
    DEVICE=bond0
    IPADDR=192.168.10.91
    NETWORK=192.168.10.0
    NETMASK=255.255.255.0
    USERCTL=no
    BOOTPROTO=none
    ONBOOT=yes
    BONDING_OPTS="mode=0 miimon=100" # use mode=0 (RR) or mode=1 (Active-backup)

  7. Configure interface eth0 as SLAVE for bond0
  8. [root@barco root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=eth0
    USERCTL=no
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes
    BOOTPROTO=none

  9. Configure interface eth1 as SLAVE for bond0
  10. [root@barco root]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
    DEVICE=eth1
    USERCTL=no
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes
    BOOTPROTO=none

  11. Restart networking service
  12. [root@barco root]# service network restart
    Shutting down interface bond0:     [ OK ]
    Shutting down interface eth0:      [ OK ]
    Shutting down interface eth1:      [ OK ]
    Shutting down loopback interface:  [ OK ]
    Setting network parameters:        [ OK ]
    Bringing up loopback interface:    [ OK ]
    Bringing up interface bond0:       [ OK ]
    Bringing up interface eth0:        [ OK ]
    Bringing up interface eth1:        [ OK ]

  13. Show interfaces configuration
  14. [root@barco root]# ifconfig
    bond0 Link encap:Ethernet HWaddr 08:00:27:4E:C8:9C
    inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
    RX packets:10072 errors:0 dropped:0 overruns:0 frame:0
    TX packets:12298 errors:137 dropped:0 overruns:0 carrier:65
    collisions:0 txqueuelen:0
    RX bytes:786205 (767.7 Kb) TX bytes:622576 (607.9 Kb)

    eth0 Link encap:Ethernet HWaddr 08:00:27:4E:C8:9C
    inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
    UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
    RX packets:3090 errors:0 dropped:0 overruns:0 frame:0
    TX packets:5777 errors:94 dropped:0 overruns:0 carrier:35
    collisions:0 txqueuelen:100
    RX bytes:254006 (248.0 Kb) TX bytes:311021 (303.7 Kb)
    Interrupt:10 Base address:0xd240

    eth1 Link encap:Ethernet HWaddr 08:00:27:4E:C8:9C
    inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
    UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
    RX packets:6982 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6521 errors:43 dropped:0 overruns:0 carrier:30
    collisions:0 txqueuelen:100
    RX bytes:532199 (519.7 Kb) TX bytes:311555 (304.2 Kb)
    Interrupt:9 Base address:0xd260

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:339 errors:0 dropped:0 overruns:0 frame:0
    TX packets:339 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:19084 (18.6 Kb) TX bytes:19084 (18.6 Kb)

  15. Show bonding interface status
  16. [root@barco root]# cat /proc/net/bond0/info
    Bonding Mode: load balancing
    MII Status: up
    MII Polling Interval (ms): 0
    Up Delay (ms): 0
    Down Delay (ms): 0

    Slave Interface: eth1
    MII Status: up
    Link Failure Count: 0

    Slave Interface: eth0
    MII Status: up
    Link Failure Count: 0

Redundancy Testing

To make sure network redundancy working properly, we must test to unplug eth0 cable while eth1 plugged and vice versa.

  1. eth0 plugged, eth1 plugged
  2. [root@barco root]# mii-tool
    eth0: negotiated 100baseTx-FD, link ok
    eth1: negotiated 100baseTx-FD, link ok

    [root@barco root]# ping -c 3 192.168.10.1
    PING 192.168.10.1 (192.168.10.1) from 192.168.10.1 : 56(84) bytes of data.
    64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=3.83 ms
    64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=3.22 ms
    64 bytes from 192.168.10.1: icmp_seq=3 ttl=64 time=3.59 ms

    --- 192.168.10.1 ping statistics ---
    3 packets transmitted, 3 received, 0% loss, time 2023ms
    rtt min/avg/max/mdev = 3.626/3.522/3.836/0.255 ms

  3. eth0 unplugged, eth1 plugged
  4. [root@barco root]# mii-tool
    eth0: no link
    eth1: negotiated 100baseTx-FD, link ok

    [root@barco root]# ping -c 3 192.168.10.1
    PING 192.168.10.1 (192.168.10.1) from 192.168.10.1 : 56(84) bytes of data.
    64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=3.83 ms
    64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=3.22 ms
    64 bytes from 192.168.10.1: icmp_seq=3 ttl=64 time=3.59 ms

    --- 192.168.10.1 ping statistics ---
    3 packets transmitted, 3 received, 0% loss, time 2023ms
    rtt min/avg/max/mdev = 3.286/3.252/3.636/0.345 ms

  5. eth0 plugged, eth1 unplugged
  6. [root@barco root]# mii-tool
    eth0: negotiated 100baseTx-FD, link ok
    eth1: no link

    [root@barco root]# ping -c 3 192.168.10.1
    PING 192.168.10.1 (192.168.10.1) from 192.168.10.1: 56(84) bytes of data.
    64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=3.83 ms
    64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=3.22 ms
    64 bytes from 192.168.10.1: icmp_seq=3 ttl=64 time=3.59 ms

    --- 192.168.10.1 ping statistics ---
    3 packets transmitted, 3 received, 0% loss, time 2023ms
    rtt min/avg/max/mdev = 3.226/3.552/3.836/0.255 ms

    OK that’s all folks, happy bonding 🙂

Refence

  1. http://www.cyberciti.biz/tips/linux-bond-or-team-multiple-network-interfaces-nic-into-single-interface.html
  2. https://www.kernel.org/doc/Documentation/networking/bonding.txt
  3. https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-networkscripts-interfaces-chan.html
Advertisements
  1. 21 May 2015 at 9:01 pm

    When someone writes an post he/she retains the plan of a user in his/her brain that how
    a user can understand it. Therefore that’s why this article is perfect.
    Thanks!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: