linux – LACP有2个NIC,当其中任何一个关闭时工作,而不是两个都工作时

我遇到了让LACP中继在Ubuntu 12.04.2 LTS上正常运行的问题.

我的设置是单个主机,连接两个10 Gbe接口连接到两个独立的Nexus 5548交换机,vPC配置为启用多机箱LACP. Nexus配置符合Cisco指南,Ubuntu配置符合https://help.ubuntu.com/community/UbuntuBonding

服务器连接到每个Nexus交换机上的端口Ethernet1 / 7,其端口配置相同并放置在端口通道15中.端口通道15配置为VPC 15,VPC输出看起来很好.这些是简单的访问端口,即不涉及801.1q中继.

图:

+----------+      +----------+      +----------+      +----------+
    | client 1 |------| nexus 1  |------| nexus 2  |------| client 2 |
    +----------+      +----------+      +----------+      +----------+
                           |                  |
                           |    +--------+    |
                           +----| server |----+
                           eth4 +--------+ eth5

当任一链接断开时,客户端1和2都能够到达服务器.但是,当我启动辅助链接时,使用新启用的链接连接到交换机的客户端无法访问服务器.
有关状态转换和结果,请参见下表:

port states (down by means of "shutdown")
     nexus 1 eth1/7        up     up    down   up
     nexus 2 eth1/7       down    up     up    up

   connectivity
    client 1 - server      OK     OK     OK   FAIL
    client 2 - server      OK    FAIL    OK    OK

现在,我相信我已经将问题分离到了Linux方面.当处于up-up状态时,每个nexus使用到服务器的本地链接来传递数据包,如通过查看mac地址表所验证的那样.我在服务器上看到的是,通过使用tcpdump -i ethX,ethX接口(来自eth4上的客户端1的数据包,来自eth4上的客户端2的数据包)收到来自每个客户端的数据包,但是当我运行tcpdump时-i bond0我只能从主机中的任何一个进行流量传输(根据我上面所说的).

我观察到ARP和ICMP(IP)流量的相同行为;当两个链路都启动时,ARP从客户端发生故障,当一个链路断开时,工作(连同ping),当我再次启用链接时ping失败(仍然在eth接口上接收数据包,但不在bond0上接收).

为了澄清,我在这个配置中设置了多个服务器,并且都显示相同的症状,因此它似乎与硬件无关.

所以 – 弄清楚如何解决这个问题就是我正在处理的事情;到目前为止,谷歌搜索还没给我带来任何好运.

任何指针都非常感谢.

的/ etc /网络/接口

auto eth4
    iface eth4 inet manual
    bond-master bond0

    auto eth5
    iface eth5 inet manual
    bond-master bond0

    auto bond0
    iface bond0 inet static
    address 10.0.11.5
    netmask 255.255.0.0
    gateway 10.0.0.3
    mtu 9216
    dns-nameservers 8.8.8.8 8.8.4.4
    bond-mode 4
    bond-miimon 100
    bond-lacp-rate 1
    #bond-slaves eth4
    bond-slaves eth4 eth5

的/ proc /净/结合/ bond0

A little further information:
    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: fast
    Min links: 0
    Aggregator selection policy (ad_select): stable
    Active Aggregator Info:
    Aggregator ID: 1
    Number of ports: 1
    Actor Key: 33
    Partner Key: 1
    Partner Mac Address: 00:00:00:00:00:00

    Slave Interface: eth4
    MII Status: up
    Speed: 10000 Mbps
    Duplex: full
    Link Failure Count: 8
    Permanent HW addr: 90:e2:ba:3f:d1:8c
    Aggregator ID: 1
    Slave queue ID: 0

    Slave Interface: eth5
    MII Status: up
    Speed: 10000 Mbps
    Duplex: full
    Link Failure Count: 13
    Permanent HW addr: 90:e2:ba:3f:d1:8d
    Aggregator ID: 2
    Slave queue ID: 0

编辑:从Nexus添加配置

vpc domain 100
      role priority 4000
      system-priority 4000
      peer-keepalive destination 10.141.10.17 source 10.141.10.12
      peer-gateway
      auto-recovery
    interface port-channel15
      description server5
      switchport access vlan 11
      spanning-tree port type edge
      speed 10000
      vpc 15
    interface Ethernet1/7
      description server5 internal eth4
      no cdp enable
      switchport access vlan 11
      channel-group 15

编辑:在IP更改之前和之后,在同一服务器的nexus1上添加了非VPC端口通道的结果(更改了IP以影响负载平衡算法).这仍然在服务器上使用相同的设置.

port states (down by means of "shutdown")
        nexus 1 eth1/7        up     up    down   up
        nexus 1 eth1/14      down    up     up    up <= port moved from nexus 2 eth1/7

   connectivity (sever at 10.0.11.5,hashing uses Eth1/14)
       client 1 - server      OK     OK     OK   FAIL
       client 2 - server      OK     OK     OK   FAIL

改变IP后的结果如预测的那样;启动未使用的接口会导致故障.

connectivity (sever at 10.0.11.15,hashing uses Eth1/7)
       client 1 - server      OK    FAIL    OK    OK
       client 2 - server      OK    FAIL    OK    OK

解决方法

我设法在Ubuntu中工作的唯一LACP配置是:
auto bond0
iface bond0 inet dhcp
  bond-mode 4
  bond-slaves none
  bond-miimon 100
  bond-lacp-rate 1
  bond-updelay 200 
  bond-downdelay 200

auto eth0
iface eth0 inet manual
  bond-master bond0

auto eth1
iface eth1 inet manual
  bond-master bond0

即我不使用债券奴隶而是债券主人.我不确定区别是什么,但我发现这个配置对我有用.

我的设置下LACP没有任何问题,尽管这是1Gbe网络.

此外,如果您仍然遇到问题,请尝试将两根电缆插入同一交换机并配置LACP端口.只是为了消除多机箱LACP问题的可能性.

相关文章

查找全部容器的日志文件 $ sudo find /var/lib/docker/conta...
Linux日志文件中列属性的详细解析
在Linux系统中没有duf命令,如何有效地管理磁盘空间?
深入探讨EncryptPad在Linux操作系统中的功能和优势
原理和应用场景:Linux中ttyload工具的工作原理和实际用途
深度解析SELinux的三种策略类型