华为M-LAG-4
配置交換機(jī)雙歸接入IP 網(wǎng)絡(luò)示例(V-STP 方式)(推薦)
如圖4-23所示,通過配置M-LAG雙歸接入IP網(wǎng)絡(luò)可以滿足以下要求:
● 當(dāng)一條接入鏈路發(fā)生故障時(shí),流量可以快速切換到另一條鏈路,保證可靠性。
● 為了高效利用帶寬,兩條鏈路同時(shí)處于active狀態(tài),可實(shí)現(xiàn)使用負(fù)載分擔(dān)的方式轉(zhuǎn)發(fā)流量。
1.配置思路
采用如下的思路配置M-LAG雙歸接入IP網(wǎng)絡(luò):
1. 在Switch上配置上行接口綁定在一個(gè)Eth-Trunk中。
2. 分別在SwitchA和SwitchB上配置V-STP、DFS Group、peer-link和M-LAG接口。
3. 分別在SwitchA和SwitchB上配置VLANIF接口IP地址和MAC地址,作為接入設(shè)備的雙活網(wǎng)關(guān)。
4. 分別在SwitchA、SwitchB和SwitchC上配置OSPF功能,保證三層互通。
說明:在V-STP場(chǎng)景下,為防止接口因生成樹協(xié)議計(jì)算結(jié)果被阻塞,可以通過配置主接口實(shí)現(xiàn)三層互通或者去使能IP網(wǎng)絡(luò)側(cè)的生成樹協(xié)議。
5. 分別在SwitchA和SwitchB上配置Monitor Link關(guān)聯(lián)上行接口和下行接口,避免因上行鏈路故障導(dǎo)致用戶側(cè)流量無法轉(zhuǎn)發(fā)而丟棄。
2.操作步驟
1.在Switch上配置上行接口綁定在一個(gè)Eth-Trunk中
<HUAWEI> system-view [~HUAWEI] sysname Switch [*HUAWEI] commit [~Switch] vlan batch 11 [*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 [*Switch-Eth-Trunk20] quit [*Switch] commit
2.分別在SwitchA和SwitchB上配置V-STP、DFS Group、peer-link和M-LAG接口
1)配置SwitchA。
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] stp mode rstp [~SwitchA] stp bridge-address 1-1-1 [*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 [*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 [*SwitchA-Eth-Trunk10] quit [*SwitchA] commit
2)配置SwitchB
<HUAWEI> system-view [~HUAWEI] sysname SwitchB [*HUAWEI] commit [~SwitchB] stp mode rstp [~SwitchB] stp bridge-address 1-1-1 [*SwitchB] stp v-stp enable [*SwitchB] interface loopback 0 [*SwitchB-LoopBack0] ip address 10.1.1.2 32 [*SwitchB-LoopBack0] quit [*SwitchB] dfs-group 1 [*SwitchB-dfs-group-1] source ip 10.1.1.2 [*SwitchB-dfs-group-1] priority 120 [*SwitchB-dfs-group-1] quit [*SwitchB] interface eth-trunk 1 [*SwitchB-Eth-Trunk1] trunkport 10ge 1/0/4 [*SwitchB-Eth-Trunk1] trunkport 10ge 2/0/5 [*SwitchB-Eth-Trunk1] mode lacp-static [*SwitchB-Eth-Trunk1] peer-link 1 [*SwitchB-Eth-Trunk1] quit [*SwitchB] vlan batch 11 [*SwitchB] interface eth-trunk 10 [*SwitchB-Eth-Trunk10] mode lacp-static [*SwitchB-Eth-Trunk10] port link-type trunk [*SwitchB-Eth-Trunk10] port trunk allow-pass vlan 11 [*SwitchB-Eth-Trunk10] trunkport 10ge 1/0/2 [*SwitchB-Eth-Trunk10] trunkport 10ge 1/0/3 [*SwitchB-Eth-Trunk10] dfs-group 1 m-lag 1 [*SwitchB-Eth-Trunk10] quit [*SwitchB] commit
3)分別在SwitchA和SwitchB上配置VLANIF接口IP地址和MAC地址,作為接入設(shè)備的雙活網(wǎng)關(guān)兩端的虛擬IP和虛擬MAC配置要求完全一致,目的是為M-LAG提供相同的虛擬IP和虛擬MAC。
# 配置SwitchA。 [~SwitchA] interface vlanif 11 [*SwitchA-Vlanif11] ip address 10.2.1.1 24 [*SwitchA-Vlanif11] mac-address 0000-5e00-0101 [*SwitchA-Vlanif11] quit [*SwitchA] commit # 配置SwitchB。 [~SwitchB] interface vlanif 11 [*SwitchB-Vlanif11] ip address 10.2.1.1 24 [*SwitchB-Vlanif11] mac-address 0000-5e00-0101 [*SwitchB-Vlanif11] quit [*SwitchB] commit
4)分別在SwitchA、SwitchB和SwitchC上配置OSPF功能,保證三層互通
# 配置SwitchA。 [~SwitchA] interface 10ge 1/0/1 [~SwitchA-10GE1/0/1] undo portswitch [*SwitchA-10GE1/0/1] ip address 10.3.1.1 24 [*SwitchA-10GE1/0/1] quit [*SwitchA] ospf 1 [*SwitchA-ospf-1] area 0 [*SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.0 [*SwitchA-ospf-1-area-0.0.0.0] network 10.2.1.0 0.0.0.255 [*SwitchA-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255 [*SwitchA-ospf-1-area-0.0.0.0] quit [*SwitchA-ospf-1] quit [*SwitchA] commit # 配置SwitchB。 [~SwitchB] interface 10ge 1/0/1 [~SwitchB-10GE1/0/1] undo portswitch [*SwitchB-10GE1/0/1] ip address 10.4.1.1 24 [*SwitchB-10GE1/0/1] quit [*SwitchB] ospf 1 [*SwitchB-ospf-1] area 0 [*SwitchB-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.0 [*SwitchB-ospf-1-area-0.0.0.0] network 10.2.1.0 0.0.0.255 [*SwitchB-ospf-1-area-0.0.0.0] network 10.4.1.0 0.0.0.255 [*SwitchB-ospf-1-area-0.0.0.0] quit [*SwitchB-ospf-1] quit [*SwitchB] commit # 配置SwitchC。 <HUAWEI> system-view [~HUAWEI] sysname SwitchC [*HUAWEI] commit [~SwitchC] interface 10ge 1/0/1 [~SwitchC-10GE1/0/1] undo portswitch [*SwitchC-10GE1/0/1] ip address 10.3.1.2 24 [*SwitchC-10GE1/0/1] quit [*SwitchC] interface 10ge 1/0/2 [*SwitchC-10GE1/0/2] undo portswitch [*SwitchC-10GE1/0/2] ip address 10.4.1.2 24 [*SwitchC-10GE1/0/2] quit [*SwitchC] ospf 1 [*SwitchC-ospf-1] area 0 [*SwitchC-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255 [*SwitchC-ospf-1-area-0.0.0.0] network 10.4.1.0 0.0.0.255 [*SwitchC-ospf-1-area-0.0.0.0] quit [*SwitchC-ospf-1] quit [*SwitchC] commit
5)分別在SwitchA和SwitchB上配置Monitor Link關(guān)聯(lián)上行接口和下行接口
# 配置SwitchA。 [~SwitchA] monitor-link group 1 [*SwitchA-mtlk-group1] port 10ge 1/0/1 uplink [*SwitchA-mtlk-group1] port eth-trunk 10 downlink 1 [*SwitchA-mtlk-group1] quit [*SwitchA] commit # 配置SwitchB。 [~SwitchB] monitor-link group 1 [*SwitchB-mtlk-group1] port 10ge 1/0/1 uplink [*SwitchB-mtlk-group1] port eth-trunk 10 downlink 1 [*SwitchB-mtlk-group1] quit [*SwitchB] commit
6)驗(yàn)證配置結(jié)果
執(zhí)行命令display dfs-group,查看M-LAG的相關(guān)信息。
# 查看DFS Group編號(hào)為1的M-LAG信息。
[~SwitchA] display dfs-group 1 m-lag * : Local node Heart beat state : OK Node 1 * Dfs-Group ID : 1 Priority : 150 Address : ip address 10.1.1.1 State : Master Causation : - System ID : 0025-9e95-7c31 SysName : SwitchA Version : V100R006C00 Device Type : CE12800 Node 2 Dfs-Group ID : 1 Priority : 120 Address : ip address 10.1.1.2 State : Backup Causation : - System ID : 0025-9e95-7c11 SysName : SwitchB Version : V100R006C00 Device Type : CE12800
# 查看SwitchA上的M-LAG信息。
[~SwitchA] display dfs-group 1 node 1 m-lag brief * - Local node M-Lag ID Interface Port State Status Consistency-check 1 Eth-Trunk 10 Up active(*)-active -- Failed reason: 1 -- Relationship between vlan and port is inconsistent 2 -- STP configuration under the port is inconsistent 3 -- STP port priority configuration is inconsistent 4 -- LACP mode of M-LAG is inconsistent 5 -- M-LAG configuration is inconsistent 6 -- The number of M-LAG members is inconsistent
# 查看SwitchB上的M-LAG信息。
[~SwitchB] display dfs-group 1 node 2 m-lag brief * - Local node M-Lag ID Interface Port State Status Consistency-check 1 Eth-Trunk 10 Up active-active(*) -- Failed reason: 1 -- Relationship between vlan and port is inconsistent 2 -- STP configuration under the port is inconsistent 3 -- STP port priority configuration is inconsistent 4 -- LACP mode of M-LAG is inconsistent 5 -- M-LAG configuration is inconsistent 6 -- The number of M-LAG members is inconsistent
通過以上顯示信息可以看到,“Heart beat state”的狀態(tài)是“OK”,表明心跳狀態(tài)正常;SwitchA作為Node 1,優(yōu)先級(jí)為150,“State”的狀態(tài)是“Master”;SwitchB作為Node 2,優(yōu)先級(jí)為120,“State”的狀態(tài)是“Backup”。
同時(shí)“Causation”的狀態(tài)是“-”,Node 1的“Port State”狀態(tài)為“Up”,Node 2的“Port State”狀態(tài)為“Up”,且Node 1和Node 2的M-LAG狀態(tài)均為“active”,表明M-LAG的配置正確。
3.配置文件
1)SwitchA的配置文件
sysname SwitchA # dfs-group 1 priority 150 source ip 10.1.1.1 # vlan batch 11 # stp mode rstp stp bridge-address 0001-0001-0001 stp v-stp enable # interface Vlanif11 ip address 10.2.1.1 255.255.255.0 mac-address 0000-5e00-0101 # interface Eth-Trunk1 mode lacp-static peer-link 1 # interface Eth-Trunk10 port link-type trunk port trunk allow-pass vlan 11 mode lacp-static dfs-group 1 m-lag 1 # interface 10GE1/0/1 undo portswitch ip address 10.3.1.1 255.255.255.0 # interface 10GE1/0/2 eth-trunk 10 # interface 10GE1/0/3 eth-trunk 10 # interface 10GE1/0/4 eth-trunk 1 interface 10GE2/0/5 eth-trunk 1 # interface LoopBack0 ip address 10.1.1.1 255.255.255.255 # monitor-link group 1 port 10GE1/0/1 uplink port Eth-Trunk10 downlink 1 # ospf 1 area 0.0.0.0 network 10.1.1.1 0.0.0.0 network 10.2.1.0 0.0.0.255 network 10.3.1.0 0.0.0.255 # return
2)SwitchC的配置文件
sysname SwitchC # interface 10GE1/0/1 undo portswitch ip address 10.3.1.2 255.255.255.0 # interface 10GE1/0/2 undo portswitch ip address 10.4.1.2 255.255.255.0 # ospf 1 area 0.0.0.0 network 10.3.1.0 0.0.0.255 network 10.4.1.0 0.0.0.255 # return
3)Switch的配置文件
sysname Switch # vlan batch 11 # interface Eth-Trunk20 port link-type trunk port trunk allow-pass vlan 11 mode lacp-static # interface 10GE1/0/1 eth-trunk 20 # interface 10GE1/0/2 eth-trunk 20 # interface 10GE1/0/3 eth-trunk 20 # interface 10GE1/0/4 eth-trunk 20 # return
4.監(jiān)控M-LAG 運(yùn)行狀況
display m-lag troubleshooting { history | current }:查看M-LAG發(fā)生故障的原因。該命令最多顯示最近100次故障的原因。
reset m-lag troubleshooting history :清除設(shè)備上已有的M-LAG歷史故障原因信息。
看看天上,于是我去了滿是風(fēng)雪的地方
總結(jié)
- 上一篇: 三角函数公式关系梳理
- 下一篇: 能源自由的终极追求 核聚变投资暴涨:最快