11

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?

ttirtawi
  • 111
  • 5
  • 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 07: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 09 '16 at 17:47
  • 6
    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 04:34
  • 1
    If you switch is configured correctly, a way to debug is: `echo 'module bonding +p' > /sys/kernel/debug/dynamic_debug/control` ... – Jiri B Dec 15 '21 at 07:20
  • 1
    @SharuzzamanAhmatRaslan Make your comment an answer! – Nils Jan 25 '22 at 21:39

1 Answers1

1

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."