一、理解
RSTP在STP基础上进行了改进,实现了网络拓扑快速收敛,但RSTP和STP还存在同一个缺陷,即由于局域网内所有的VLAN共享一棵生成树,链路被阻塞后将不承载任何流量,造成带宽浪费,因此无法在VLAN间实现数据流量的负载均衡,还有可能造成部分VLAN的报文无法转发。
通过MSTP把一个交换网络划分成多个域,每个域内形成多棵生成树,生成树之间彼此独立。每个域叫做一个MST域,每棵生成树叫做一个多生成树实例 MSTI。
实例内可以包含多个VLAN。通过将多个VLAN映射到同一个实例内,可以节省通信开销和资源占用率。MSTP 各个实例拓扑的生成树计算相互独立,通过这些实例可以实现负载均衡。把多个相同拓扑结构的 VLAN映射到一个实例里,这些VLAN在端口上的转发状态取决于端口在对应 MSTP 实例的状态。
MSTP通过设置 VLAN映射表(即 VLAN和 MSTI 的对应关系表),把 VLAN 和MSTI联系起来。每个VLAN 只能对应一个MSTI,即同一VLAN的数据只能在一个MSTI中传输,而一个MSTI可能对应多个VLAN。
二、配置
如图,将VLAN41划分到实例1、VLAN42划分到实例2,并选取交换机三为实例1的根桥、交换机二为实例2的根桥。

[LW1]vlan batch 41 42
[LWl]interface E0/0/3
[LW1-Ethernet0/0/3]port link-type access
[LW1-Ethernet0/0/3]port default vlan 41
[LW1-Ethernet0/0/3]interface E0/0/1
[LW1-Ethernet0/0/1]port link-type trunk
[LW1-Ethernet0/0/1]port trunk allow-pass vlan all
[LW1-Ethernet0/0/1]interface E0/0/2
[LW1-Ethernet0/0/2]port link-type trunk
[LW1-Ethernet0/0/2]port trunk allow-pass vlan all
[LW1-Ethernet0/0/2]
[LW2]vlan batch 41 42
[Lw2]interface E0/0/3
[LW2-Etherneto/o/3]port link-type access
[LW2-Etherneto/0/3]port default vlan 42
[LW2-Etherneto/o/3]interface E0/0/1
[LW2-Etherneto/0/1]port link-type trunk
[LW2-Etherneto/0/1lport trunk allow-pass vlan all
[Ln2-Etherneto/o/1jinterface E0/0/2
[Lw2-Ethernet0/0/2]port link-type trunk
[LW2-Ethernet0/0/2]port trunk allow-pass vlan all
[Lw3]vlan batch 41 42
[Lw3]interface E0/0/3
[Lw3-Ethernet0/0/3]port link-type access
[Lw3-Ethernet0/0/3]port default vlan 41
[Lw3-Ethernet0/0/3]interface E0/0/4
[LW3-Ethernet0/0/4]port link-type access
[LW3-Ethernet0/0/4]port default vlan 42
[Lw3-Ethernet0/0/4]interface E0/0/2
[Lw3-Ethernet0/0/2]port link-type trunk
[Lw3-Ethernet0/0/2]port trunk allow-pass vlan all
[Lw3-Ethernet0/0/2]interface E0/0/1
[Lw3-Ethernet0/0/1]port link-type trunk
[Lw3-Ethernet0/0/1]port trunk allow-pass vlan all

<LW1>sys
[LW1]stp region-configuration
[LW1-mst-region]region-name wu
[Lw1-mst-region]region-level 1
[Lw1-mst-region]revision-level 1
[Lw1-mst-regionjinstance 1 vlan 41
[Lw1-mst-region]instance 2 vlan42
[Lw1-mst-region]active region-configuration
LW2、LW3也是如此配置
人为修改实例的根节点
[LW3]stp instance 1 root primary
[LW2]stp instance 2 root primary

4373





