电脑计算机论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 484|回复: 0

mstp+vrrp 之 mstp 简介

[复制链接]
admin 发表于 2022-10-30 20:27:19 | 显示全部楼层 |阅读模式
简单来说,MSTP就是基于VLAN的RSTP.
MSTP 是在传统的STP、RSTP 的基础上发展而来的新的生成树协议.
包含了RSTP 的快速FORWARDING 机制。
1.png
MSTP 把一台交换机的一个或多个vlan 划分为一个instance,有着相同instance 配置的交换机就组成一个域(MST region),运行独立的生成树(IST,internal spanning-tree);
这个MST region 就相当于一个大的交换机,与其他MST region 再进行生成树算法运算,得出一个整体的生成树,称为CST(common spanning tree)。
2.png


与 STP/RSTP 相比,MSTP 中引入了“实例”(Instance)和“域”(Region) “的概念。
 所谓“实例”就是多个 VLAN 的一个集合。使用的时候可以把多个相同业务的 VLAN 映
射到某一个实例中。MSTP 拓扑计算以实例为维度,各个实例独立破环。通过 VLAN
和实例的映射,可以实现在这些实例上实现负载均衡。缺省情况下,所有的 VLAN 都
映射到实例 0 上。除实例 0 外的其他实例叫做多生成树实例。
 所谓“域”,由域名、修订级别、VLAN 与实例的映射关系(mapping of VIDs to spanning trees)
组成。每个域内所有交换机都要有相同的 MST 域配置,也就是说多台交换机域中的三
个配置完全相同时,才属于同一个域。缺省情况下,域名就是交换机的桥 MAC 地址,
修订级别等于 0,所有的 VLAN 都映射到实例 0 上。


配置举例
3.png

如图所示,当前网络中 SwitchA、SwitchB、SwitchC 和 SwitchD 通过环形组网备份链路,同
时对两个用户的流量进行负载分担。希望通过运行 MSTP 协议阻塞特定端口,将环形网络
结构修剪成无环路的树形网络结构。
 部门 1 和部门 2 的流量进行负载分担。
 SwitchA 和 SwitchB 分别作为两个部门的根桥和备份根桥。
 SwitchC 和 SwitchD 连接用户的接口 GE1/0/3 不要参与 STP 计算。


配置思路
采用如下的思路配置 MSTP:
1. 创建 VLAN,并把接口加入 VLAN。2. 配置模式是 MSTP 模式。
3. 配置域名为 RG1,并配置域内 VLAN 和实例的映射关系。
4. 配置 SwitchA 和 SwitchB 分别作为两个部门的根桥和备份根桥。
5. 统一使用默认路径开销。华为交换机默认的路径开销计算标准使用的是标准的 dot1t。
GE 接口默认路径开销是 20000,而 Ethernet 接口默认路径开销是 200000。注意:eNSP
模拟器中,STP 的路径开销默认是 1。
6. SwitchC 和 SwitchD 的 GE1/0/3 端口去使能 STP 协议。
7. SwitchA、SwitchB、SwitchC 和 SwitchD 使能 STP 协议。


操作步骤
步骤 1:创建 VLAN,并把接口加入 VLAN。
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 2 to 4094
[SwitchA] interface gigabitethernet0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 4094
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
[SwitchA-GigabitEthernet0/0/2] quit
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 2 to 4094
[SwitchB] interface gigabitethernet0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 4094
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type trunk
[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
[SwitchB-GigabitEthernet0/0/2] quit
<HUAWEI> system-view
[HUAWEI] sysname SwitchC
[SwitchC] vlan batch 2 to 4094
[SwitchC] interface gigabitethernet0/0/1
[SwitchC-GigabitEthernet0/0/1] port link-type trunk
[SwitchC-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 4094
[SwitchC-GigabitEthernet0/0/1] quit
[SwitchC] interface gigabitethernet0/0/2
[SwitchC-GigabitEthernet0/0/2] port link-type trunk
[SwitchC-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
[SwitchC-GigabitEthernet0/0/2] quit<HUAWEI> system-view
[HUAWEI] sysname SwitchD
[SwitchD] vlan batch 2 to 4094
[SwitchD] interface gigabitethernet0/0/1
[SwitchD-GigabitEthernet0/0/1] port link-type trunk
[SwitchD-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 4094
[SwitchD-GigabitEthernet0/0/1] quit
[SwitchD] interface gigabitethernet0/0/2
[SwitchD-GigabitEthernet0/0/2] port link-type trunk
[SwitchD-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
[SwitchD-GigabitEthernet0/0/2] quit
步骤 2:配置模式为 MSTP 模式。
华为交换机默认是 MSTP 模式,该步骤可以省略。
[SwitchA] stp mode mstp
[SwitchB] stp mode mstp
[SwitchC] stp mode mstp
[SwitchD] stp mode mstp
步骤 3:配置域名为 RG1,并配置域内 VLAN 和实例的映射关系。
注意 4 台设备的域配置需要完全一致,才可以正确破环。
[SwitchA] stp region-configuration //进入到stp配置模式
[SwitchA-mst-region] region-name RG1 //配置域名为 RG1
[SwitchA-mst-region] instance 1 vlan 1 to 200 //默认所有 VLAN 都属于实例 0,这里把
VLAN1~200 映射为实例 1,其他 VLAN201~4094 还是属于实例 0
[SwitchA-mst-region] active region-configuration //域内的配置,需要激活才能生效
[SwitchA-mst-region] quit
[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name RG1
[SwitchB-mst-region] instance 1 vlan 1 to 200
[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region] quit
[SwitchC] stp region-configuration
[SwitchC-mst-region] region-name RG1
[SwitchC-mst-region] instance 1 vlan 1 to 200
[SwitchC-mst-region] active region-configuration
[SwitchC-mst-region] quit
[SwitchD] stp region-configuration
[SwitchD-mst-region] region-name RG1
[SwitchD-mst-region] instance 1 vlan 1 to 200
[SwitchD-mst-region] active region-configuration
[SwitchD-mst-region] quit步骤 4:配置根桥和备份根桥。
配置在实例 0 中 SwitchA 为根桥,SwitchB 为备份根桥。在实例 1 中 SwitchA 为备份根桥,
SwitchB 为根桥。
[SwitchA] stp instance 0 root primary //也可以使用命令 stp priority 0 配置优先级为 0,和
stp root primary 的作用是一样的。
[SwitchA] stp instance 1 root secondary //也可以使用命令 stp priority 4096 配置优先级为
4096,和 stp root secondary 的作用是一样的。
[SwitchB] stp instance 0 root secondary
[SwitchB] stp instance 1 root primary
步骤 5:去使能 SwitchB 和 SwitchC 设备 GE0/0/3 端口的 STP 功能。
[SwitchC] interface gigabitethernet0/0/3
[SwitchC-GigabitEthernet0/0/3] stp disable
[SwitchC-GigabitEthernet0/0/3] quit
[SwitchD] interface gigabitethernet 0/0/3
[SwitchD-GigabitEthernet0/0/3] stp disable
[SwitchD-GigabitEthernet0/0/3] quit
步骤 6:全局使能 STP 功能。
华为 X7 系列交换机默认是使能,该步骤可以省略。
[SwitchA] stp enable
[SwitchB] stp enable
[SwitchC] stp enable
[SwitchD] stp enable



您需要登录后才可以回帖 登录 | 注册

本版积分规则


QQ|手机版|小黑屋|电脑计算机论坛 ( 京ICP备2022023538号-1 )

GMT+8, 2024-3-29 06:44 , Processed in 0.076375 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表