NVIDIA Mellanox 交换机 Onyx 配置 L2 MLAG,基础案例
本案例描述如何在 NVIDIA Mellanox 交换机系统(Mellanox Onyx)配置 MLAG。赛诺实验室。
组网示意图:
必要的网络规划:
Onyx1 | Onyx2 | |
Mgmt0:IP | 192.168.1.111 /24 | 192.168.1.112 /24 |
virtual IP (VIP) | 192.168.1.253 /24 | |
MLAG domain | test-vip | |
IPL vlan | 4000 | 4000 |
IPL PO1 | 1/21,1/22 | 1/21,1/22 |
IPL IP address | 1.1.1.1 /30 | 1.1.1.2 /30 |
MLAG interface for L3 switch | 1/20 | 1/20 |
MLAG interface for host | 1/1 | 1/1 |
No MLAG interface | 1/2 | 1/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:
在交换机 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.
在交换机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
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 常用命令
switch [test-vip: master] (config)# show mlag2、Examine the MLAG summary table. Run:
switch [test-vip: master] (config)# show interfaces mlag-port-channel summary3、Examine the MLAG statistics. Run:
switch [test-vip: master] (config)# show mlag statistics
与 NVIDIA产品相关的图片或视频(完整或部分)的版权均归 NVIDIA Corporation 所有。