当第一个接口关闭时,以太网绑定循环不起作用

当第一个接口关闭时,以太网绑定循环不起作用

我试图理解绑定模式=0(负载平衡循环)。使用 eth0 和 eth1,我创建了 bond0 接口,配置如下:

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接口建立成功:

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:~#

然后我尝试断开eth0的网线,ping测试报告IP无法访问。我知道这种故障转移场景肯定适用于 mode=1(主动备份)。

**更新:eth0 插入后绑定状态

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:~#

同样奇怪的是,当我在 eth0 保持拔出状态的情况下重新启动服务器时,绑定接口根本没有启动。尽管配置仍然将 eth1 作为活动/连接接口。

粘合文档表示balance-rr或模式0提供负载平衡和容错能力。我只是好奇知道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.

有人可以帮我弄清楚绑定模式=0是否需要两个接口都处于活动状态吗?如果是,那么 mode=0 如何提供容错能力?

答案1

你如何配置你的交换机?

在粘合文档中:

“balance-rr、balance-xor 和广播模式通常要求交换机将适当的端口分组在一起。这种组的术语在交换机之间有所不同,它可能被称为“etherchannel”(如上面的 Cisco 示例中所示) )、“中继组”或其他类似的变体。”

相关内容