Bond 与 Cisco 和 Arista 交换机的互操作性

这篇知识库文章讨论了混合交换机拓扑中的互操作性和故障排除,其中运行 Cumulus Linux 的交换机与运行 Cisco 和 Arista 网络操作系统的交换机在同一网络中。本文使用了 ifupdown2 的语法。

环境

  • Cumulus Linux 2.1 及更高版本

混合交换机拓扑示例

以下描述的三个示例使用下图,所有测试均在实际设备上执行。两侧使用相同的接口;例如,Cumulus Linux 交换机上的 swp19(交换机端口 19)连接到 Cisco 3560 上的 g0/19(千兆以太网 0/19)。

Cumulus Linux 和 Cisco IOS

以下示例使用慢速 LACPDUs(即,bond-lacp-rate 设置为 0)

Quanta LY2 w/Cumulus Linux 4.2.0Cisco WS-C3560X-24 12.2(55)SE5
auto bond1

iface bond1
bond-slaves glob swp19-20
bond-miimon 100
bond-min-links 1
bond-mode 802.3ad
bond-xmit-hash-policy layer3+4 bond-lacp-rate 0

auto vlan10
iface vlan10
bridge-ports bond1.10
address 10.10.10.11/24
bridge-stp on
vlan 10

interface GigabitEthernet0/19
switchport trunk encapsulation dot1q switchport mode trunk channel-group 1 mode active interface GigabitEthernet0/20 switchport trunk encapsulati on dot1q switchport mode trunk channel-group 1 mode active

interface Port-channel1
switchport trunk encapsulation dot1q switchport mode trunk

interface Vlan10
ip address 10.10.10.10 255.2

Cumulus Linux 和 Arista EOS

以下示例使用快速 LACPDUs(其中 bond-lacp-rate 设置为 1)

Quanta LY2 w/Cumulus Linux 4.2.0Arista DCS-7148S-R 4.13.5F
auto bond2

iface bond2
bond-slaves glob swp37-38
bond-miimon 100
bond-min-links 1
bond-mode 802.3ad
bond-xmit-hash-policy layer3+4 bond-lacp-rate 1

auto vlan12
iface vlan12
bridge_ports bond2.12
address 12.12.12.11/24
bridge-stp on
interface Ethernet37

switchport mode trunk
channel-group 2 mode active interface Ethernet38 switchport mode trunk channel-group 2 mode active

interface Port-Channel2
switchport trunk allowed vlan 12 switchport mode trunk

interface Vlan12
ip address 12.12.12.12/24

Cumulus Linux 和 Cisco NX-OS

以下示例使用快速 LACPDUs(其中 bond-lacp-rate 设置为 1)

Quanta LY2 w/Cumulus Linux 4.2.0Cisco Nexus3064 5.0(3)U2(2c)
auto bond3

iface bond3
bond-slaves glob swp39-40
bond-miimon 100
bond-min-links 1
bond-mode 802.3ad
bond-xmit-hash-policy layer3+4 bond-lacp-rate 1

auto vlan14
iface vlan14
bridge-ports bond3.14
address 14.14.14.11/24
bridge-stp on
feature interface-vlan
feature lacp

vlan 14

interface Ethernet1/39
switchport mode trunk
channel-group 3 mode active
interface Ethernet1/40
switchport mode trunk
channel-group 3 mode active

interface port-channel3
switchport mode trunk

interface Vlan14
no shutdown
ip address 14.14.14.14/24

EtherChannel 最常见的三个问题是

  • 第 2 层 Bond 的 VLAN 不匹配
  • LACPDUs 的快速与慢速 LACP 速率
  • 双方都使用被动 LACP 模式而不是主动 LACP 模式

由于 Cumulus Linux 是 Linux,因此它使用的 Bond 内核语法与您在 kernel.org 文档中找到的相同。Cumulus Linux Bond 文档包含具体示例。以下指南比较了图表和上述配置中的 Cisco 3560 和 Quanta LY2。

Bond 参数

以下是在 Cumulus Linux 中配置 Bond 的推荐方法

auto bond0
iface bond0
    bond-slaves swp1 swp2
    bond-mode 802.3ad
    bond-miimon 100
    bond-lacp-rate 1
    bond-min-links 1
    bond-xmit-hash-policy layer3+4
  • bond-slaves 等同于 Bond 的成员。在本例中,swp1 和 swp2 是 bond0 的成员;LACP Bond 需要 bond-mode 802.3ad。
  • bond-miimon 100 是故障检测频率。默认值为 0,但 NVIDIA 建议为 100。
  • bond-lacp-rate 1 表示快速 LACP,请参阅下面的快速与慢速 LACP 速率;NVIDIA 建议使用快速 LACP。
  • bond-min-links 是一个整数,指示 Bond 变为活动状态必须启动的链路数。
  • bond-xmit-hash-policy 必须设置为 layer3+4,以便均匀分布。

要阅读有关 Bond 参数的更多信息,请阅读 kernel.org 文档

VLAN 不匹配

以下配置存在 VLAN 不匹配。您能找到它吗?

Quanta LY2 w/Cumulus Linux 4.2.0Cisco WS-C3560X-24 12.2(55)SE5
auto bond1
iface bond1
bond-slaves glob swp19-20
bond-miimon 100
bond-min-links 1
bond-mode 802.3ad
bond-xmit-hash-policy layer3+4 bond-lacp-rate 0

auto vlan10
iface vlan10
bridge-ports bond1.100
address 10.10.10.11/24
bridge-stp on
vlan 10

interface GigabitEthernet0/19
switchport trunk encapsulation dot1q switchport mode trunk channel-group 1 mode active interface GigabitEthernet0/20 switchport trunk encapsulation dot1q switchport mode trunk channel-group 1 mode active

interface Port-channel1
switchport trunk encapsulation dot1q switchport mode trunk

interface Vlan10
ip address 10.10.10.10 255.255.255.0

如上所示,名为 *vlan10* 的网桥指示此网桥的成员是 bond1.100。名称 *vlan10* 并不意味着您必须使用 *vlan10* 标记网桥成员。该名称与网桥内的 802.1q 标签无关。子接口 .100 (bond1.100) 表示标记的入口数据包成为 VLAN 100 的成员,但在名为 *vlan10* 的网桥中。此语法是正确的,但可能不是您想要的结果。您可以将网桥命名为任何名称,例如 *mgmt-bridge* 或 *outofband*。

与 Cisco IOS 不同,Cumulus Linux 会丢弃数据包,除非您将标记的子接口加入网桥或第 3 层接口。许多 IOS 和类似 IOS 的设备都执行类似的操作

switchport trunk allowed vlan 5

这仅允许 vlan5,其他都不允许。Cumulus Linux 则相反,它会丢弃所有内容,除非允许它进入。

您可以在 Cumulus Linux 用户指南中找到有关配置 VLAN 标记的更多信息。

快速与慢速 LACP 速率

Cumulus Linux 文档建议

bond-lacp-rate 1

这意味着 *快速*;根据 kernel.org 文档,它意味着“请求合作伙伴每 1 秒传输 LACPDUs。”

在某些情况下,其他供应商可能无法执行快速 LACPDUs,或者可能存在一些其他未知要求需要慢速 LACP。要配置慢速速率,请使用

bond-lacp-rate 0

根据 kernel.org,这意味着“请求合作伙伴每 30 秒传输 LACPDUs。”

快速与慢速故障排除

要查看 Bond 配置及其运行情况,请使用此命令

cat /proc/net/bonding/bond1

以下输出是收到的信息片段

cumulus@switch:~$ cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer3+4 (1)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: slow

在 Cisco 交换机上,您可以像这样检查端口通道

show etherchannel summary

以下输出是收到的信息片段

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Gi0/19(P)   Gi0/20(P)

请注意,端口通道在两个端口上都已启动,并且看起来不错。要查看 Cisco 端的 LACPDU 速度,请运行以下命令

show etherchannel detail

以下输出是收到的信息片段

Local information:
                            LACP port     Admin     Oper    Port        Port
Port      Flags   State     Priority      Key       Key     Number      State
Gi0/19    SA      bndl      32768         0x1       0x1     0x114       0x3D

Partner's information:

                  LACP port                        Admin  Oper   Port    Port
Port      Flags   Priority  Dev ID          Age    key    Key    Number  State
Gi0/19    SA      255       089e.01ce.e216   3s    0x0    0x11   0x1     0x3D

其中 *SA* 标志表示

A - Device is in active mode
S - Device is sending Slow LACPDUs

确保双方匹配对于流量通过以及 Bond 保持启动和稳定至关重要。在上述情况下,它们都使用了慢速 LACPDUs。下表可帮助您匹配

Cumulus LinuxCisco速率
LACP rate: slowS每 30 秒
LACP rate: fastF每秒

主动与被动模式

Cumulus Linux 当前不支持被动模式。由于主动模式适用于主动和被动配置,并且 Cumulus Linux 没有更改它的旋钮,因此运行 Cumulus Linux 的交换机与其他网络操作系统供应商的交换机之间不存在互操作性问题。