NVIDIA Mellanox 交换机 Onyx 配置 L2 MLAG,基础案例

2023-07-27 17:18:15 昌辉 2192


本案例描述如何在 NVIDIA Mellanox 交换机系统(Mellanox Onyx)配置 MLAG。赛诺实验室。

组网示意图:mlag

必要的网络规划:


Onyx1Onyx2
Mgmt0:IP192.168.1.111 /24192.168.1.112 /24
virtual IP (VIP)192.168.1.253 /24
MLAG domaintest-vip
IPL vlan40004000
IPL PO11/21,1/221/21,1/22
IPL IP address
1.1.1.1 /301.1.1.2 /30
MLAG interface for L3 switch1/201/20
MLAG interface for host1/11/1
No MLAG interface1/21/2


前提:

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、给 inter-peer link (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、Set an IP address and netmask for the VLAN interface. Configure IP address for the IPL link on both switches:

The IPL IP address should not be part of the management network, it could be any IP address and subnet that is not in use in the network. This address is not advertised outside the switch.

在交换机 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、Map the VLAN interface to be used on the IPL and set the peer IP address (the IP address of the IPL port on the second switch) of the IPL peer port. IPL peer ports must be configured on the same netmask.

在交换机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、Configure a virtual IP (VIP) for the MLAG. MLAG VIP is important for retrieving peer information.

If you have a mgmt0 interface, the IP address should be within the subnet of the management interface. Do not use mgmt1. The management network is used for keepalive messages between the switches. The MLAG domain must be unique name for each MLAG domain. In case you have more than one pair of MLAG switches on the same network, each domain (consist of two switches) should be configured with different name.

在交换机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模式都适用,支持的模式有:

- balance-rr: mode 0

- balance-xor: mode 2

- 802.3ad (LACP): mode 4

Sinoinfo_Pic

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、Examine MLAG configuration and status. Run:
switch [test-vip: master] (config)# show mlag
2、Examine the MLAG summary table. Run:
switch [test-vip: master] (config)# show interfaces mlag-port-channel summary
3、Examine the MLAG statistics. Run:
switch [test-vip: master] (config)# show mlag statistics


与 NVIDIA产品相关的图片或视频(完整或部分)的版权均归 NVIDIA Corporation 所有。

微信公众号