前不久项目上碰到一个技术M-lag,当时因为有人带,没有深入了解m-lag,通过这篇文章来深入了解下m-lag。
一、什么是M-lag
M-lag(Multichassis Link Aggregation Group)跨设备链路聚合组。将两台交换机以同一个状态和被接入的设备进行链路协商,从而把链路可靠性从单板级提高到了设备级,组成双活系统(两个设备都承载业务)。
优点:
1、增加带宽、提高链路可靠性、负载分担。
2、简化组网和配置:m-lag提供了一个没有环路的二层拓扑同时实现了冗余备份,不再需要繁琐的生成树协议配置。
3、独立升级:两台设备独立升级,一台设备正常工作即可,对业务几乎没有影响。
二、M-lag名词解释
DFS Group:动态交换服务组DFS Group(Dynamic Fabric Service Group),主要用于部署M-LAG设备之间的配对,M-LAG双归设备之间的接口状态,表项等信息同步需要依赖DFS Group协议进行同步。
DFS主/备设备:部署m-lag且状态为主/备的设备。
双主检测链路:又称心跳链路,三层互通链路,用于m-lag主备设备之间发送双主检测报文。
peer-link链路:peer-link链路是一条直连链路且必须做链路聚合,用于交换协商报文及传输部分流量。接口配置为peer-link接口后,该接口上不能再配置其它业务。为了增加peer-link链路的可靠性,推荐采用多条链路做链路聚合。
HB DFS主/备设备:通过心跳链路来协商的状态为主/备的设备。(与HB DFS主备不冲突,只是在二次故障恢复场景下,在原DFS主设备或备设备故障恢复且peer-link链路仍然故障时,通过使HB DFS备设备上相应端口down,来避免m-lag设备在双主下出现的流量异常。
三、M-lag实验(v-stp模式)
1、拓扑图
2、配置思路
-
在Switch上配置上行接口绑定在一个Eth-Trunk中。
-
分别在SwitchA和SwitchB上配置V-STP、DFS Group、peer-link和M-LAG接口。
-
分别在SwitchA和SwitchB上配置VLANIF接口IP地址和MAC地址,作为接入设备的双活网关。
-
分别在SwitchA、SwitchB和SwitchC上配置OSPF功能,保证三层互通。
-
分别在SwitchA和SwitchB上配置Monitor Link关联上行接口和下行接口,避免因上行链路故障导致用户侧流量无法转发而丢弃。
3、配置步骤
1、Switch上配置上行接口绑定在一个Eth-Trunk中
[~Switch] vlan batch 11 #通过vlan11与上层通信 [*Switch] interface eth-trunk 20 [*Switch-Eth-Trunk20] mode lacp-static [*Switch-Eth-Trunk20] port link-type trunk [*Switch-Eth-Trunk20] port trunk allow-pass vlan 11 [*Switch-Eth-Trunk20] trunkport 10ge 1/0/1 to 1/0/4
2、分别在SwitchA和SwitchB上配置V-STP、DFS Group、peer-link和M-LAG接口
[~SwitchA] stp mode rstp [*SwitchA] stp v-stp enable [*SwitchA] interface loopback 0 [*SwitchA-LoopBack0] ip address 10.1.1.1 32 [*SwitchA-LoopBack0] quit [*SwitchA] dfs-group 1 [*SwitchA-dfs-group-1] source ip 10.1.1.1 [*SwitchA-dfs-group-1] priority 150 [*SwitchA-dfs-group-1] quit [*SwitchA] interface eth-trunk 1 [*SwitchA-Eth-Trunk1] trunkport 10ge 1/0/4 [*SwitchA-Eth-Trunk1] trunkport 10ge 2/0/5 [*SwitchA-Eth-Trunk1] mode lacp-static [*SwitchA-Eth-Trunk1] peer-link 1 [*SwitchA-Eth-Trunk1] quit [*SwitchA] vlan batch 11 [*SwitchA] interface eth-trunk 10 [*SwitchA-Eth-Trunk10] mode lacp-static #通过聚合口10连接switch B [*SwitchA-Eth-Trunk10] port link-type trunk [*SwitchA-Eth-Trunk10] port trunk allow-pass vlan 11 [*SwitchA-Eth-Trunk10] trunkport 10ge 1/0/2 [*SwitchA-Eth-Trunk10] trunkport 10ge 1/0/3 [*SwitchA-Eth-Trunk10] dfs-group 1 m-lag 1
3、分别在A和B上配置vlanif接口ip地址和mac地址,作为接入设备的双活网关,两端的虚拟ip和虚拟mac配置要求完全一致,为m-lag提供相同的虚拟ip和虚拟mac。
[~SwitchA] interface vlanif 11 [*SwitchA-Vlanif11] ip address 10.2.1.1 24 [*SwitchA-Vlanif11] mac-address 0000-5e00-0101
4、配置ospf保证三层互通(不在演示)
5、在A和B上配置Monitor Link关联上下行接口(避免因上行链路故障导致用户侧流量无法转发而丢弃。)
[~SwitchB] monitor-link group 1 [*SwitchB-mtlk-group1] port 10ge 1/0/1 uplink [*SwitchB-mtlk-group1] port eth-trunk 10 downlink 1