在认识M-LAG之前,推荐先阅读以下文章:
1. 堆叠 VS M-LAGM-LAG(Multichassis Link Aggregation Group,跨设备链路聚合组),顾名思义,提供跨设备链路聚合 功能,从而将链路可靠性从单板级提高到设备级 。
堆叠其实已经包含了跨设备链路聚合功能,而M-LAG与堆叠的主要区别在于,M-LAG的控制平面完全独立 ,这使得主备设备的CPU负载平均分担,不会全部落到主设备上,并且网络割接时可以做到秒级无感中断 ,而堆叠却会造成20s-60s左右的中断。
对比维度
堆叠
M-LAG
虚拟化平面与耦合度
控制平面和转发平面全实现虚拟化,设备间耦合度高
仅在部分数据平面和控制平面实现虚拟化,设备间耦合度低
可靠性
故障可能在成员设备上扩散
控制平面独立,故障域隔离,可靠性更高
运维
管理节点数减少,配置简单
需要管理两台交换机,运维复杂度稍高
故障收敛性能
收敛性能与单设备接近
需通过协议传递故障切换信息,收敛性能稍弱于堆叠
升级复杂度与中断时间
升级操作时间长、风险高,业务中断约 20 秒~1 分钟(与业务量强相关)
两台交换机可独立升级,不中断业务访问,流量毫秒级中断,应用无感知
适用场景
对软件版本升级中断时间无要求、要求维护简单的场景
对升级中断时间要求高、可靠性要求高且可接受一定维护复杂度的场景,数据中心多采用 M-LAG
2. M-LAG组网M-LAG只支持2台设备 进行一主一备的组网方式,两设备通过动态交换服务组DFS Group (Dynamic Fabric Service Group)进行配对并协商出主备关系(优先级高的为主,若优先级相同,则MAC地址小的为主),完成主备协商后,再通过两设备间的peer-link链路 实时同步同步MAC和ARP等表项。
M-LAG本身具有防环机制 ,多条peer-link链路不会导致环路,对于广播报文,也能进行单方向隔离。
但是M-LAG在和其他接入设备或者网络侧设备进行STP组网时,通常需要对外呈现为一台设备进行STP协议计算 ,因此还需要用到V-STP 将两台设备的STP协议虚拟成一台设备的STP协议。
和堆叠类似,M-LAG也需要MAD多主检测 来阻止peer-link链路失效后的网络故障。
3. M-LAG实验 实验拓扑图
3.1. M-LAG配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 sysname SW1 vlan 100 stp mode rstp stp v-stp enable stp bpdu-protection stp tc-protection interface MEth0/0/0 ip address 172.16.1.1 255.255.255.252 dfs-group 1 priority 150 authentication-mode hmac-sha256 password Admin dual-active detection source ip 172.16.1.1 peer 172.16.1.2 interface Eth-Trunk1 mode lacp -static trunkport GE 1 /0 /1 trunkport GE 1 /0 /2 peer-link 1 port vlan exclude 1 interface Eth-Trunk2 port link-type trunk port trunk allow-pass vlan 100 mode lacp -static dfs-group 1 m-lag 1 trunkport GE 1 /0 /3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 sysname SW2 vlan 100 stp mode rstp stp v-stp enable stp bpdu-protection stp tc-protection interface MEth0/0/0 ip address 172.16.1.2 255.255.255.252 dfs-group 1 authentication-mode hmac-sha256 password Admin dual-active detection source ip 172.16.1.2 peer 172.16.1.1 interface Eth-Trunk1 mode lacp -static trunkport GE 1 /0 /1 trunkport GE 1 /0 /2 peer-link 1 port vlan exclude 1 interface Eth-Trunk2 port link-type trunk port trunk allow-pass vlan 100 mode lacp -static dfs-group 1 m-lag 1 trunkport GE 1 /0 /3
display stp v-stp:
display dfs-group 1:
display dfs-group 1 m-lag:
`display stp v-stp:
display dfs-group 1:
display dfs-group 1 m-lag:
SW1上shutdown掉peer-link接口g1/0/1和g1/0/2,使peer-link链路断开:
dis interface brief可以看到SW2的M-LAG成员接口被error-down:
通信不受影响:
3.2. 配置双活网关
1 2 3 4 5 6 7 8 9 10 11 12 interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 100 mode lacp -static trunkport GE 1 /0 /9 trunkport GE 1 /0 /10 interface GE1/0 /1 port link-type access port default vlan 100
1 2 3 4 5 6 interface Vlanif100 ip address 192.168.100.254 24 display bridge mac-address mac-address fac7-f460-0020
1 2 3 4 5 interface Vlanif100 ip address 192.168.100.254 24 mac-address fac7-f460-0020
PC可以ping通自己的网关:
将SW1的g1/0/3 shutdown,通信不受影响:
原因是SW2的g1/0/3作为M-LAG的成员接口,还能正常工作:
将SW2的g1/0/3也shutdown,通信会失败:
将SW1的g1/0/3恢复,通信恢复:
3.3. OSPF + NAT
1 2 3 4 5 6 7 8 9 interface GE1/0 /10 undo portswitch ip address 10.0.1.1 30 ospf 1 router-id 2.2.2.2 area 0 network 10.0.1.0 0.0.0.3 network 192.168.100.0 0.0.0.255
1 2 3 4 5 6 7 8 9 interface GE1/0 /10 undo portswitch ip address 10.0.2.1 30 ospf 1 router-id 3.3.3.3 area 0 network 10.0.2.1 0.0.0.0 network 192.168.100.0 0.0.0.255
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 interface GE0/0 /1 ip address 10.0.1.2 30 interface GE0/0 /2 ip address 10.0.2.2 30 interface GE0/0 /9 ip address 6.6.6.5 30 nat enable nat -policy rule name snat source-address 192.168.100.0 mask 255.255.255.0 action source-nat easy-ip ospf 1 router-id 1.1.1.1 default-route-advertise always area 0 network 10.0.1.0 0.0.0.3 network 10.0.2.0 0.0.0.3 ip route-static 0.0.0.0 0.0.0.0 6.6.6.6
出口AR上面可以看到已建立邻接关系:
去往内网的路由条目也同步到了:
M-LAG设备也获取到了默认路由条目:
PC可以通过Easy IP NAT访问外网:
出口AR可以捕获到NAT会话日志:
4. 参考文档https://info.support.huawei.com/info-finder/encyclopedia/zh/M-LAG.html https://support.huawei.com/enterprise/zh/doc/EDOC1100366635/aa9d7fc6 https://mp.weixin.qq.com/s/r0WGApsuyR6LqIv7oRYYHw
lololowe
恬淡无为
打赏作者
感谢你赐予我前进的力量
Bitcoin
Ethereum