![通道绑定接口的 MAC 地址分配](https://linux22.com/image/594764/%E9%80%9A%E9%81%93%E7%BB%91%E5%AE%9A%E6%8E%A5%E5%8F%A3%E7%9A%84%20MAC%20%E5%9C%B0%E5%9D%80%E5%88%86%E9%85%8D.png)
我已经使用 balance-alb (mode=6) 选项配置了 Channel-bonding (在 RHEL/CentOS 上):
BONDING_OPTS="mode=balance-alb miimon=100 updelay=200 downdelay=200"
其运行正常,且根据/proc/net/bonding/bond0
,主动从属是eth1
。
[root@baba ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)
Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 200
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:19:00:00:00:fb
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:06:11:11:11:3b
(我故意将 MAC 的中间位替换为 00 和 11)
现在,根据ifconfig
,eth0 和 eth1 的 MAC 地址分配不同(从上面的输出) - 它们被切换了。
[root@baba ~]# ifconfig | sed -n '/^[a-z]*[0-9]/p'
bond0 Link encap:Ethernet HWaddr 00:19:00:00:00:FB
eth0 Link encap:Ethernet HWaddr 00:06:11:11:11:3B
eth1 Link encap:Ethernet HWaddr 00:19:00:00:00:FB
有人知道我为什么会看到这个吗?或者它是如何工作的?提前谢谢。干杯!!
答案1
1)eth0加入绑定,绑定采用eth0的MAC地址。
2)eth1加入绑定。
3)由于某种原因,eth1 成为活动从属设备,并出现以下行为:
If the receiving slave fails, another slave
takes over the MAC address of the failed
receiving slave.
来源:https://www.kernel.org/doc/Documentation/networking/bonding.txt
MAC 地址的更改似乎按预期进行。