7

I'm trying to understand the bonding mode=0 (load balancing round-robin). Using eth0 & eth1, I created bond0 interface as the configuration below :

root@test-env1:~# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
NM_CONTROLLED=no
USERCTL=no
BOOTPROTO=static
IPADDR=192.168.57.91
NETMASK=255.255.255.0
GATEWAY=192.168.57.1
BONDING_OPTS="mode=0 miimon=100"
root@test-env1:~#
root@test-env1:~# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
USERCTL=no
root@test-env1:~# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
USERCTL=no
root@test-env1:~# 

Bonding interface established successfully :

root@test-env1:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 100
Down Delay (ms): 100

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:30:0d:9e
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:a0:fc:9e
Slave queue ID: 0
root@test-env1:~#

Then I tried to disconnect the cable of eth0, ping test reported that the IP became unreachable. I know that kind of failover scenario will definitely works with mode=1 (active-backup).

**Update : status of bond after eth0 plugged

root@test-env1:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: down
Speed: Unknown
Duplex: Unknown
Link Failure Count: 1
Permanent HW addr: 08:00:27:30:0d:9e
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:a0:fc:9e
Slave queue ID: 0
root@test-env1:~#

It also strange that when I rebooted the server with eth0 remain unplugged, bond interface didn't UP at all. Although the configuration still have eth1 as active/connected interface.

Bonding documentation said that balance-rr or mode 0 provides load balancing and fault tolerance. I just curious the know what kind of fault tolerance that provided by bonding mode=0.

mode

    Specifies one of the bonding policies. The default is
    balance-rr (round robin).  Possible values are:

    balance-rr or 0

        Round-robin policy: Transmit packets in sequential
        order from the first available slave through the
        last.  This mode provides load balancing and fault
        tolerance.

Could someone help me figure it out whether the bond mode=0 requires both interface to be active? If yes, then how mode=0 provides the fault tolerance?

  • Just for completeness' sake: when you unplugged eth0, its status went to down in /proc/net/bonding/bond0, so we're sure the system noticed it went away? – Ulrich Schwarz Dec 12 '15 at 7:07
  • Yes MII Status: down – ttirtawi Dec 12 '15 at 14:43
  • What is the output in your syslog when you unplug one cable ? – Thomas Oct 9 '16 at 17:47
  • 2
    How do you configure your switch? In bonding documentation: "The balance-rr, balance-xor and broadcast modes generally require that the switch have the appropriate ports grouped together. The nomenclature for such a group differs between switches, it may be called an “etherchannel” (as in the Cisco example, above), a “trunk group” or some other similar variation." – Sharuzzaman Ahmat Raslan Oct 31 '16 at 4:34
0

As per the explanation from Mode 1 we can assume that for mode 0 both slaves are active. So, in your case Whenever the packet reaches the slave which is up you will be able to get response for your ping.

balance-rr or 0

Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

active-backup or 1

Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.