Linux 绑定模式 802.3ad 未激活

Mat*_*Mat 3 cisco debian switch bonding lacp

在运行Debian Stretch的服务器上,我使用802.3ad 模式配置了一个bond0,如下所示:

auto bond0
iface bond0 inet manual
        slaves eth0 eth2
        bond_miimon 100
        bond_mode 802.3ad
Run Code Online (Sandbox Code Playgroud)

bond0接口启动并运行,但它的工作与负载平衡(循环)模式:

root@servir01:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

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: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: e4:1f:13:65:f0:c4
Slave queue ID: 0

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: e4:1f:13:36:a3:ac
Slave queue ID: 0
Run Code Online (Sandbox Code Playgroud)

在交换机上正确创建了 LAG 并启用了 LACP,并且它的两个端口都已启动并正在运行:

[滞后状态[1]

Unit3/端口1的状态

Unit4/端口1的状态

同一台机器有另一个以相同方式配置的绑定接口(eth1 和 eth3 接口上的bond1),连接在相同的交换机上,并且 LACP 运行良好:

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: e4:1f:13:65:f0:c6
Active Aggregator Info:
    Aggregator ID: 1
    Number of ports: 2
    Actor Key: 9
    Partner Key: 1010
Run Code Online (Sandbox Code Playgroud)

为什么bond0 接口不想启用LACP?我错在哪里?

小智 5

老问题,但由于它在搜索中很早就出现了,而且我有类似的设置,但遇到了同样的问题。这是我的工作方式,(在 Debian 上使用 ifenslave)...

/etc/network/interfaces...

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # bond0 is the bonded NIC and can be used like any other normal NIC.
    # bond0 is configured using static addressing.
    auto bond0
    iface bond0 inet static
    address <your static address>
    gateway <your gateway>
    # bond0 uses standard IEEE 802.3ad LACP bonding protocol
    bond-mode 4
    bond-miimon 100
    bond-lacp-rate 0 (This is on a small NAS, so no rush)
    bond-slaves none

    # eth0 is manually configured, and enslaved to the "bond0" pseudo NIC
    allow_hotplug eth0
    auto eth0
    iface eth0 inet manual
    bond-master bond0

    # eth1 ditto, thus creating a 2-link bond.
    allow_hotplug eth1
    auto eth1
    iface eth1 inet manual
    bond-master bond0
Run Code Online (Sandbox Code Playgroud)

原因是什么?

嗯,NIC 会出现,bonding 驱动程序会抓住它们,然后 NIC 会下降以重新配置为从属,bonding 驱动程序会因为它没有从属而恐慌,然后像无头鸡一样四处乱跑(循环)。

现在,bonding 驱动程序出现,发现它没有从节点,所以它坐下来等待......他们都走了。