一、什么是MSTP?
MSTP兼容STP和RSTP,通过多实例能实现对业务流量和用户流量的隔离,同时还提供了数据转发的多个冗余路径,在数据转发过程中实现VLAN数据的负载均衡。
在MSTP中,你可以将若干个VLAN映射到一个实例(instance),MSTP将为每个instance运行一颗生成树,可以基于instance设置优先级、端口路径开销等参数。
二、MSTP的生成背景
RSTP与STP共同的缺陷:由于局域网内所有的VLAN共享一颗生成树,因此无法实现在VLAN之间实现数据流量的平均分配,链路被阻塞之后将不承担任何流量。
鉴于此基础上,IEEE发布了MSTP,他将VLAN根据不同的划分位集中实例,每个实例对应不同的生成树,所以可以实现数据流量的负载均衡,同时也解决了因VLAN过多而引起的资源占用过大的问题。
三、MSTP实验
交换机配置mstp,sw1为vlan10的主,vlan20的备,sw2为vlan20的主,vlan10的备,配置R1的loopback口为1.1.1.1,使得pc1和pc2可以ping通1.1.1.1
R1的代码
The device is running!
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int loo
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip address 1.1.1.1 32
[Huawei-LoopBack0]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.10.1 24
Apr 12 2021 13:28:41-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]q
[Huawei]undo info
[Huawei]undo info-center en
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.20.1 24
[Huawei-GigabitEthernet0/0/1]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
SW1的代码
The device is running!
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p h u v 10 20
[Huawei-Ethernet0/0/1]
Apr 12 2021 14:14:12-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 4, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei-Ethernet0/0/1]q
[Huawei]undo info
[Huawei]undo info-center
^
Error:Incomplete command found at '^' position.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]vlan batch
^
Error:Incomplete command found at '^' position.
[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p h u v 10 20
[Huawei-Ethernet0/0/1]int e 0/0/3
[Huawei-Ethernet0/0/3]p l t
[Huawei-Ethernet0/0/3]p t a v a
[Huawei-Ethernet0/0/3]int e0/0/2
[Huawei-Ethernet0/0/2] User interface con0 is available
Please Press ENT