华为交换机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)

相关推荐
蝎子莱莱爱打怪3 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
DianSan_ERP4 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅4 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
不是二师兄的八戒4 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
王码码20354 天前
Flutter for OpenHarmony:socket_io_client 实时通信的事实标准(Node.js 后端的最佳拍档) 深度解析与鸿蒙适配指南
android·flutter·ui·华为·node.js·harmonyos
zhangfeng11334 天前
趋动云 如何ssh登录 服务区 项目server
运维·人工智能·ssh
ZeroNews内网穿透4 天前
谷歌封杀OpenClaw背后:本地部署或是出路
运维·服务器·数据库·安全
失重外太空啦4 天前
nginx
运维·nginx
2501_946205524 天前
晶圆机器人双臂怎么选型?适配2-12寸晶圆的末端效应器有哪些?
服务器·网络·机器人
Gofarlic_oms14 天前
避免Kisssoft高级分析模块过度采购的科学评估方法
大数据·linux·运维·人工智能·matlab