必要的网络规划:
前提:
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 地址:
在交换机 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 对于检索对等信息非常重要。
在交换机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 常用命令
switch [
test
-vip: master] (config)
# show mlag
|
switch [
test
-vip: master] (config)
# show interfaces mlag-port-channel summary
|
switch [
test
-vip: master] (config)
# show mlag statistics