2025-03-14 14:56:47 版本 : NVIDIA Mellanox 交换机 Onyx 配置 L2 MLAG,基础案例
作者: 李永鑫 于 2025年03月14日 发布在分类 / Mellanox / IB交换机 下,并于 2025年03月14日 编辑
 历史版本

备注 修改日期 修改人
创建版本 2025-03-14 15:06:19[当前版本] 李永鑫
创建版本 2025-03-14 14:56:47 李永鑫


粘贴图片


必要的网络规划:

粘贴图片

前提:

1、开启L3 功能

switch (config) # ip routing

2、开启链路聚合

switch (config) # lacp

3、在交换机上启用 QoS 以避免 IPL 端口拥塞

switch (config) # dcb priority-flow-control enable force

4、开启MLAG 协议

switch (config) # protocol mlag


配置IPL:

1、给 对等链路 (IPL) 创建VLAN

switch (config) # vlan 4000
switch (config vlan 4000) # exit

2、创建LAG

switch (config) # interface port-channel 1
switch (config interface port-channel 1) # exit

3、将物理端口映射到处于活动模式 (LACP) 的 LAG

switch (config) # interface ethernet 1/21-1/22 channel-group 1 mode active

4、将此 LAG 设置为 IPL

switch (config) # interface port-channel 1
switch (config interface port-channel 1) # ipl 1

5、在此特定接口上启用 QoS

switch (config interface port-channel 1) # dcb priority-flow-control mode on force

6、创建 IPL vlan 接口,并设置MTU

switch (config) # interface vlan 4000
switch (config interface vlan 4000) # mtu 9216


7、设置VLAN接口的IP地址和网络掩码。为两台交换机上的 IPL 链路配置 IP 地址:

IPL IP 地址不应是管理网络的一部分,它可以是网络中未使用的任何 IP 地址和子网。此地址不会在交换机外部通告。

在交换机 onyx1

onyx1 (config interface vlan 4000) # ip address 1.1.1.1 /30

在交换机onyx2

onyx2 (config interface vlan 4000) # ip address 1.1.1.2 /30


8、映射IPL上要使用的VLAN接口,设置IPL对端端口的对端IP地址(第二台交换机上IPL端口的IP地址)。IPL 对等端口必须在同一网络掩码上配置。

在交换机onyx1

onyx1 (config interface vlan 4000) # ipl 1 peer-address 1.1.1.2

在交换机onyx2

onyx2 (config interface vlan 4000) # ipl 1 peer-address 1.1.1.1


9、为虚拟网络配置虚拟IP(VIP)。MLAG VIP 对于检索对等信息非常重要。

如果您有 mgmt0 接口,则 IP 地址应位于管理接口的子网内。不要使用 mgmt1。管理网络用于交换机之间的保持连接消息。MLAG 域必须是每个 MLAG 域的唯一名称。如果同一网络上有多对 MLAG 交换机,则应为每个域(由两个交换机组成)配置不同的名称。

在交换机onyx1

onyx1 (config) # mlag-vip test-vip ip 192.168.1.253 /24

在交换机onyx2

onyx2 (config) # mlag-vip test-vip


10、[可选] 为 MLAG 配置虚拟系统 MAC

switch (config) # mlag system-mac 00:00:5E:00:01:5D


创建MLAG 接口

重要提示

并非所有bond模式都适用,支持的模式有:

- 平衡RR:模式 0

- 平衡异或:模式2

- 802.3ad (LACP):模式 4

粘贴图片

1、创建连接服务器节点 的 MLAG 接口

switch (config) # interface mlag-port-channel 1
switch (config interface mlag-port-channel 1) # exit

2、绑定以太网端口到 MLAG 组

switch (config) #  interface ethernet 1/1 mlag-channel-group 1 mode on

3、创建连接L3 交换机的 MLAG接口,上行出口

switch (config) # interface mlag-port-channel 20
switch (config interface mlag-port-channel 20) # exit
switch (config) #  interface ethernet 1/20 mlag-channel-group 20 mode active

以上3个步骤在 2台交换机都需要配置


另外:

如果服务器的bond模式 mode=1,是主备模式,则交换机端口不能配置为mlag 端口,只需要配置pvid,或者默认 vlan 1

本案例的 1/2 用来接 服务器网卡bond模式 mode=1的配置,网卡bonding配置参考链接


开启MLAG 功能

switch [my-vip: master] (config)  # mlag
switch [my-vip: master] (config mlag)  # no shutdown


检查 MLAG 常用命令

1、检查MLAG配置和状态。跑:
switch [ test -vip: master] (config) # show mlag
2、检查MLAG汇总表。跑:
switch [ test -vip: master] (config) # show interfaces mlag-port-channel summary
3、检查MLAG统计数据。跑:
switch [ test -vip: master] (config) # show mlag statistics
历史版本-目录  [回到顶端]
    知识分享平台 -V 5.2.5 -wcp