华为交换机MSTP和VRRP综合应用配置

采用"双核心"的冗余网络,可以保证网络的稳定性。利用MSTP(多生成树协议)和VRRP(虚拟路由冗余协议)提高网络可靠性。

一、基本配置

LSW1:

<Huawei>sys

Enter system view, return user view with Ctrl+Z.

Huawei\]undo info-center ena Info: Information center is disabled. \[Huawei\]sys LSW1 \[LSW1\]vlan batch 10 20 Info: This operation may take a few seconds. Please wait for a moment...done. \[LSW1\]int vlan 10 \[LSW1-Vlanif10\]ip add 192.168.10.252 24 \[LSW1-Vlanif10\]int vlan 20 \[LSW1-Vlanif20\]ip add 192.168.20.252 24 \[LSW1-Vlanif20\]int g0/0/1 \[LSW1-GigabitEthernet0/0/1\]p l t \[LSW1-GigabitEthernet0/0/1\]p t a v 10 20 \[LSW1-GigabitEthernet0/0/1\]int g0/0/2 \[LSW1-GigabitEthernet0/0/2\]p l t \[LSW1-GigabitEthernet0/0/2\]p t a v 10 20 \[LSW1-GigabitEthernet0/0/2\]qu \[LSW1\]int eth \[LSW1\]int Eth-Trunk 1 \[LSW1-Eth-Trunk1\]p l t \[LSW1-Eth-Trunk1\]p t a v 10 20 \[LSW1-Eth-Trunk1\]qu \[LSW1\]int g0/0/23 \[LSW1-GigabitEthernet0/0/23\]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment....done. \[LSW1-GigabitEthernet0/0/23\]int g0/0/24 \[LSW1-GigabitEthernet0/0/24\]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment...done. \[LSW1-GigabitEthernet0/0/24\]qu LSW2: \sys Enter system view, return user view with Ctrl+Z. \[Huawei\]undo info-center ena Info: Information center is disabled. \[LSW\]sysn LSW2 \[LSW2\]vlan batch 10 20 Info: This operation may take a few seconds. Please wait for a moment...done. \[LSW2\]int vlan 10 \[LSW2-Vlanif10\]ip add 192.168.10.253 24 \[LSW2-Vlanif10\]int vlan 20 \[LSW2-Vlanif20\]ip add 192.168.20.253 24 \[LSW2-Vlanif20\]int g0/0/1 \[LSW2-GigabitEthernet0/0/1\]p l t \[LSW2-GigabitEthernet0/0/1\]p t a v 10 20 \[LSW2-GigabitEthernet0/0/1\]int g0/0/2 \[LSW2-GigabitEthernet0/0/2\]p l t \[LSW2-GigabitEthernet0/0/2\]p t a v 10 20 \[LSW2-GigabitEthernet0/0/2\]qu \[LSW2\]int eth \[LSW2\]int Eth-Trunk 1 \[LSW2-Eth-Trunk1\]p l t \[LSW2-Eth-Trunk1\]p t a v 10 20 \[LSW2-Eth-Trunk1\]int g0/0/23 \[LSW2-GigabitEthernet0/0/23\]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment...done. \[LSW2-GigabitEthernet0/0/23\]int g0/0/24 \[LSW2-GigabitEthernet0/0/24\]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment...done. \[LSW2-GigabitEthernet0/0/24\]qu LSW3: \sys Enter system view, return user view with Ctrl+Z. \[Huawei\]undo info-center ena Info: Information center is disabled. \[LSW\]sysn LSW3 \[LSW3\]vlan batch 10 20 Info: This operation may take a few seconds. Please wait for a moment...done. \[LSW3\]int e0/0/1 \[LSW3-Ethernet0/0/1\]p l a \[LSW3-Ethernet0/0/1\]p d v 10 \[LSW3-Ethernet0/0/1\]int e0/0/2 \[LSW3-Ethernet0/0/2\]p l a \[LSW3-Ethernet0/0/2\]p d v 20 \[LSW3-Ethernet0/0/2\]int g0/0/1 \[LSW3-GigabitEthernet0/0/1\]p l t \[LSW3-GigabitEthernet0/0/1\]p t a v 10 20 \[LSW3-GigabitEthernet0/0/1\]int g0/0/2 \[LSW3-GigabitEthernet0/0/2\]p l t \[LSW3-GigabitEthernet0/0/2\]p t a v 10 20 \[LSW3-GigabitEthernet0/0/2\]qu LSW4: \sys Enter system view, return user view with Ctrl+Z. \[Huawei\]undo info-center ena Info: Information center is disabled. \[Huawei\]sysn LSW4 \[LSW4\]vlan batch 10 20 Info: This operation may take a few seconds. Please wait for a moment...done. \[LSW4\]int e0/0/1 \[LSW4-Ethernet0/0/1\]p l a \[LSW4-Ethernet0/0/1\]p d v 10 \[LSW4-Ethernet0/0/1\]int e0/0/2 \[LSW4-Ethernet0/0/2\]p l a \[LSW4-Ethernet0/0/2\]p d v 20 \[LSW4-Ethernet0/0/2\]int g0/0/1 \[LSW4-GigabitEthernet0/0/1\]p l t \[LSW4-GigabitEthernet0/0/1\]p t a v 10 20 \[LSW4-GigabitEthernet0/0/1\]int g0/0/2 \[LSW4-GigabitEthernet0/0/2\]p l t \[LSW4-GigabitEthernet0/0/2\]p t a v 10 20 \[LSW4-GigabitEthernet0/0/2\]qu 二、交换机的MSTP配置 LSW1: \[LSW1\]stp in \[LSW1\]stp instance 1 priority 4096 \[LSW1\]stp instance 2 priority 0 \[LSW1\]stp region-configuration \[LSW1-mst-region\]region-name test \[LSW1-mst-region\]revision-level 1 \[LSW1-mst-region\]instance 1 vlan 10 \[LSW1-mst-region\]instance 2 vlan 20 \[LSW1-mst-region\]active region-configuration Info: This operation may take a few seconds. Please wait for a mome \[LSW1-mst-region\]qu LSW2: \[LSW2\]stp instance 1 priority 0 \[LSW2\]stp instance 2 priority 4096 \[LSW2\]stp region-configuration \[LSW2-mst-region\]region-name test \[LSW2-mst-region\]revision-level 1 \[LSW2-mst-region\]instance 1 vlan 10 \[LSW2-mst-region\]instance 2 vlan 20 \[LSW2-mst-region\]active region-configuration Info: This operation may take a few seconds. Please wait for a moment...done. LSW3: \[LSW3\]stp region-configuration \[LSW3-mst-region\]region-name test \[LSW3-mst-region\]revision-level 1 \[LSW3-mst-region\]instance 1 vlan 10 \[LSW3-mst-region\]instance 2 vlan 20 \[LSW3-mst-region\]active region-configuration Info: This operation may take a few seconds. Please wait for a moment...done. \[LSW3-mst-region\]qu LSW4: \[LSW4\]stp region-configuration \[LSW4-mst-region\]region-name test \[LSW4-mst-region\]revision-level 1 \[LSW4-mst-region\]instance 1 vlan 10 \[LSW4-mst-region\]instance 2 vlan 20 \[LSW4-mst-region\]active region-configuration Info: This operation may take a few seconds. Please wait for a moment...done. \[LSW4-mst-region\]qu 三、交换机的VRRP配置 LSW1: \[LSW1\]int vlan 10 \[LSW1-Vlanif10\]vrrp vrid 10 virtual-ip 192.168.10.254 \[LSW1-Vlanif10\]vrrp vrid 10 priority 120 \[LSW1-Vlanif10\]qu \[LSW1\]int vlan 20 \[LSW1-Vlanif20\]vrrp vrid 20 virtual-ip 192.168.20.254 \[LSW1-Vlanif20\]qu LSW2: \[LSW2\]int vlan 10 \[LSW2-Vlanif10\]vrrp vrid 10 virtual-ip 192.168.10.254 \[LSW2-Vlanif10\] int vlan 20 \[LSW2-Vlanif20\]vrrp vrid 20 virtual-ip 192.168.20.254 \[LSW2-Vlanif20\]vrrp vrid 20 priority 150 \[LSW2-Vlanif20\]qu 四、验证 ![](https://i-blog.csdnimg.cn/direct/a87384b720a743d18c840bc990c12042.png)![](https://i-blog.csdnimg.cn/direct/10296534b15041529acd5614b7ab4ad1.png)![](https://i-blog.csdnimg.cn/direct/8b737ee9d1ab4255b418942bce0013f9.png)![](https://i-blog.csdnimg.cn/direct/29f6cbdec8c74a0492ac2a297be06322.png)

相关推荐
cur1es1 天前
【UDP的报文结构】
网络·网络协议·udp·md5
早點睡3901 天前
高级进阶 ReactNative for Harmony 项目鸿蒙化三方库集成实战:react-native-video
react native·华为·harmonyos
开开心心就好1 天前
发票合并打印工具,多页布局设置实时预览
linux·运维·服务器·windows·pdf·harmonyos·1024程序员节
惊讶的猫1 天前
OpenFeign(声明式HTTP客户端)
网络·网络协议·http·微服务·openfeign
火车叼位1 天前
脚本伪装:让 Python 与 Node.js 像原生 Shell 命令一样运行
运维·javascript·python
迎仔1 天前
06-存储设备运维进阶:算力中心的存储管家
运维
心.c1 天前
TCP协议深入解析
网络·网络协议·tcp/ip
?re?ta?rd?ed?1 天前
linux中的调度策略
linux·运维·服务器
摇滚侠1 天前
HTTP 404 - No response body available
网络·网络协议·http
全栈工程师修炼指南1 天前
Nginx | stream content 阶段:TCP 协议四层反向代理浅析与实践
运维·网络·网络协议·tcp/ip·nginx