当前位置: 首页 > backend >正文

华为配置篇-RSTP/MSTP实验

MSTP

  • 一、简介
  • 二、常用命令总结
  • 三、实验

一、简介

RSTP(快速生成树协议)​
RSTP(Rapid Spanning Tree Protocol)是 STP 的改进版本,基于 ​​IEEE 802.1w 标准​​,核心目标是解决传统 STP 收敛速度慢的问题。其通过引入 ​​快速过渡机制​​ 和 ​​新增端口角色​​(如替代端口、备份端口、边缘端口),将收敛时间从 STP 的 30-50 秒缩短至 ​​1 秒以内​​。

  • 端口角色扩展​​:除根端口、指定端口外,新增替代端口(Alternate Port)和备份端口(Backup Port),用于快速接管失效链路。
  • ​​快速状态转换​​:通过P/A( ​​Proposal/Agreement )机制​​直接协商端口状态,跳过 STP 的监听和学习阶段。
  • ​​兼容性​​:当检测到传统 STP BPDU 时,自动切换为 STP 模式。

MSTP(多生成树协议)
MSTP(Multiple Spanning Tree Protocol)基于 ​​IEEE 802.1s 标准​​,支持多生成树实例(MSTI)​​,允许不同 VLAN 组映射到不同的生成树实例,实现逻辑拓扑的灵活划分。

  • 实例化与区域划分​​:将网络划分为多个 ​​MST 区域​​,每个区域独立运行生成树,并通过 ​​CST(公共生成树)​​ 连接不同区域。
  • ​​VLAN 映射​​:通过配置 ​​VLAN-实例映射表​​,将流量分配到不同实例,避免单一生成树的资源浪费。
  • ​​BPDU 优化​​:使用 MST BPDU 携带区域和实例信息,减少控制报文数量。

二、常用命令总结

display stp						#查 STP 的状态和统计信息
display stp instance 0 brief	#查看 STP 的状态和统计信息摘要,特殊实例0
display stp interface GigabitEthernet 0/0/2	#查看 GE0/0/2 接口的 STP 的状态和统计信息,可查看port cost的开销#优先级确定根桥
stp priority 4096				#调整 STP 优先级,默认32768,越小越好
#直接指定根桥
stp root primary				#相当于优先级为0
stp root secondary				#相当于优先级为4096[S4-GigabitEthernet0/0/2] stp cost 40001	#修改GE0/0/2 接口的 STP cost 值为 40001。影响根路径开销,进而改变本端口角色。
[S1-GigabitEthernet0/0/11] stp port priority 64	#修改 GE0/0/11 的 STP 接口优先级,默认为128,越小越好。影响对端端口角色。display stp region-configuration	#检查 MSTP 实例和 VLAN 的映射关系
display stp instance 1 brief		#查看 MSTI1 的状态和统计信息摘要#配置MSTI1 的根桥和备份根桥
[S1]stp instance 1 root primary
[S2]stp instance 1 root secondary

三、实验

背景
你是公司的网络管理员。公司的网络采用了备份网络,为避免环路问题,在网络中部署了RSTP。所有的 VLAN 共享一棵 STP 生成树,为了实现VLAN 间数据流量的负载均衡, 在网络中部署 MSTP

拓扑
在这里插入图片描述

配置-RSTP模式

#
sysname S1
#
stp enable
stp mode rstp
stp instance 0 root primary				#直接设置为根桥
#
interface GigabitEthernet0/0/11stp instance 0 port priority 64		#设置stp接口优先级
#
return #
sysname S2
#
stp enable
stp mode rstp
stp instance 0 root secondary
#
return #
sysname S3
#
stp enable
stp mode rstp
#
return #
sysname S4
#
stp enable
stp mode rstp
#
interface GigabitEthernet0/0/2stp instance 0 cost 40001			#设置stp接口开销
#
return 

配置-MSTP模式
S1

#
sysname S1
#
vlan batch 10 20 30 40 50 60 70 80
#
stp instance 0 root primary
stp instance 1 root primary
stp instance 2 root secondary
#
stp region-configurationregion-name hcip				#配置区域名revision-level 1				#配置修订版本,默认0instance 1 vlan 10 30 50 70 	#设置实例1 对应vlaninstance 2 vlan 20 40 60 80 	#设置实例2 对应vlanactive region-configuration	#激活区域配置
#
interface GigabitEthernet0/0/10port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/11port link-type trunkport trunk allow-pass vlan 2 to 4094stp instance 0 port priority 64
#
interface GigabitEthernet0/0/12port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/13port link-type trunkport trunk allow-pass vlan 2 to 4094
#
return 

S2

#
sysname S2
#
vlan batch 10 20 30 40 50 60 70 80
#
stp instance 0 root secondary
stp instance 1 root secondary
stp instance 2 root primary
#
stp region-configurationregion-name hciprevision-level 1instance 1 vlan 10 30 50 70 instance 2 vlan 20 40 60 80 active region-configuration
#
interface GigabitEthernet0/0/10port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/11port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/12port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/13port link-type trunkport trunk allow-pass vlan 2 to 4094
#
return 

S3

#
sysname S3
#
vlan batch 10 20 30 40 50 60 70 80
#
stp region-configurationregion-name hciprevision-level 1instance 1 vlan 10 30 50 70 instance 2 vlan 20 40 60 80 active region-configuration
#
interface GigabitEthernet0/0/1port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3port link-type trunkport trunk allow-pass vlan 2 to 4094
#
return 

S4

#
sysname S4
#
vlan batch 10 20 30 40 50 60 70 80
#
stp region-configurationregion-name hciprevision-level 1instance 1 vlan 10 30 50 70 instance 2 vlan 20 40 60 80 active region-configuration
#
interface GigabitEthernet0/0/1port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2port link-type trunkport trunk allow-pass vlan 2 to 4094stp instance 0 cost 40001
#
interface GigabitEthernet0/0/3port link-type trunkport trunk allow-pass vlan 2 to 4094
#
return 

总结
根桥选举:桥ID(桥priorityMAC地址),越小越好,抢占式。
根接口选举:根路径开销PRC上行桥ID(BID)、上行接口优先级上行接口ID(PID)、本地接口ID,越小越好。

http://www.xdnf.cn/news/5374.html

相关文章:

  • 股指期货的保证金交易和资金门槛是多少?
  • 《Go小技巧易错点100例》第三十三篇
  • Redis--常见数据类型List列表
  • 思维链框架:LLMChain,OpenAI,PromptTemplate
  • 游戏引擎学习第274天:基于弹簧的动态动画
  • 【MySQL】表空间结构 - 从何为表空间到段页详解
  • 【质量管理】什么是过程?
  • Qt 窗口部件(2)输入部件详解
  • 深入解析STM32中断机制:从原理到外部中断实战
  • 力扣70题解
  • 二叉搜索树讲解
  • [思维模式-25]:《本质思考力》-6- 马克思主义哲学的五对基本哲学范畴,以及在计算机领域的体现
  • 用c语言实现——一个交互式的中序线索二叉树系统,支持用户动态构建、线索化、遍历和查询功能
  • 理性地倾听与表达:检索算法的语言学改进
  • 《P1226 【模板】快速幂》
  • 开疆智能Profinet转canopen网关连接易福门(IFM)传感器配置案例
  • QB/T 1649-2024 聚苯乙烯泡沫塑料包装材料检测
  • 大模型MCP更高效的通信:StreamableHTTP协议
  • 欧拉计划 Project Euler 69(欧拉总计函数与最大值)题解
  • 炫酷粒子系统动画实战:Matplotlib实现银河漩涡效果
  • SierraNet M1288网络损伤功能显著助力GPU互联网络的测试验证,包含包喷洒,LLR等复杂特性的验证测试
  • GMS 与非 GMS:有何区别?
  • Java基础:代理
  • KNOWLEDGE-BASED SYSTEMS(KBS期刊)投稿经验分享
  • # 深度学习实操 附录B 深入解析 tensorflow 自动微分
  • 纯惯性导航、非线性最小二乘法纯uwb测距导航定位、惯性uwb松组合导航、惯性uwb紧组合导航,四种方法对比
  • 圆角边框 盒子阴影 文字阴影
  • Linux进程间通信(四)之补充【日志】
  • PCB设计实践(十三)PCB设计中差分线间距与线宽设置的深度解析
  • 蓝牙GAP协议概述