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?