在Linux服务器配置bond mode 4的时候,需要在对端交换机配置链路聚合(LACP)
如上图中的红色框中的Dynamic(动态配置链路聚合),指的就是LACP。本例用2、3接口配置LACP,在配置界面勾选即可(如上图)
配置完成后可以查看LACP相关信息:
去交换机对端的服务器上校验服务器的LACP配置是否正确:
2024.5 补充 服务器网卡的状态 (只有1个工作时):
Permanent HW addr: 14:18:77:58:f8:c6 (上图第一个网卡 才有,下面的网卡没有)
若 Permanent HW add是00:00:00:00:00:00(即,上图第二个网卡)的话意味着交换机没配置或没配正确的LACP 。 导致服务虽然是mode4 ,但只有一个网卡传输流量。
这时是fallback模式,就像bond只有一个NIC一样传输。(不能2倍速率)
root@infra:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
System priority: 65535
System MAC address: 14:18:77:58:f8:c7
Active Aggregator Info:
Aggregator ID: 1
Number of ports: 2
Actor Key: 9
Partner Key: 4
Partner Mac Address: 00:e0:0c:00:00:fd
Slave Interface: em3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 14:18:77:58:f8:c7
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
system priority: 65535
system mac address: 14:18:77:58:f8:c7
port key: 9
port priority: 255
port number: 1
port state: 61
details partner lacp pdu:
system priority: 32768
system mac address: 00:e0:0c:00:00:fd
oper key: 4
port priority: 32768
port number: 3
port state: 61
Slave Interface: em2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 14:18:77:58:f8:c6
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
system priority: 65535
system mac address: 14:18:77:58:f8:c7
port key: 9
port priority: 255
port number: 2
port state: 61
details partner lacp pdu: //【对端信息】
system priority: 32768
system mac address: 00:e0:0c:00:00:fd //【两端配置都正确的话,能看到对端MAC 。否则都是0】
oper key: 4
port priority: 32768
port number: 2
port state: 61
Permanent HW addr: 14:18:77:58:f8:c6 .....