目录
MSTP学习 思维导图
实验任务
为实现VLAN2~VLAN10和VLAN11~VLAN20的流量负载分担,MSTP引入了多实例。MSTP可设置VLAN映射表,把VLAN和生成树实例联系起来。图1中RouterA、SwitchA、SwitchB、SwitchC和SwitchD都运行MSTP
实验拓扑
MSTP配置思路
采用以下思路配置MSTP功能:
在处于环形网络中的交换设备上配置MSTP基本功能,包括:配置环网中的设备生成树协议工作在MSTP模式。
配置MST域并创建多实例,实现流量的负载分担。
在MST域内,配置各实例的根桥与备份根桥。
配置各实例中某端口的路径开销值,实现将该端口阻塞。
使能MSTP,实现破除环路,包括:设备全局使能MSTP。
与终端设备相连的端口,去使能MSTP,或者配置为边缘端口。
除与终端设备相连的端口外,其他端口使能MSTP。
与PC机相连的端口不用参与MSTP计算,建议将其去使能MSTP,或者配置为边缘端口。
配置保护功能,实现对设备或链路的保护。例如:在各实例的根桥设备指定端口配置根保护功能。
配置设备的二层转发功能。
配置命令
Router A
sy
sysname RouterA
#
vlan batch 2 to 20
#
stp instance 1 root primary
stp instance 2 root primary
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface g0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp root-protection
#
interface g0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp root-protection
#
return
Switch A
sysname SwitchA
#
vlan batch 2 to 20
#
stp instance 1 root secondary
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface g0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface g0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface g0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return
Switch B
sysname SwitchB
#
vlan batch 2 to 20
#
stp instance 2 root secondary
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface g0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface g0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface g0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return
Switch C
#
sysname SwitchC
#
vlan batch 2 to 10
#
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface g0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 10
#
interface g0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 10
stp disable
#
interface g0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 10
stp disable
#
interface g0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 10
stp instance 1 cost 200000
#
return
Switch D
#
sysname SwitchD
#
vlan batch 11 to 20
#
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interfaceg0/0/1
port link-type trunk
port trunk allow-pass vlan 11 to 20
#
interface g0/0/2
port link-type trunk
port trunk allow-pass vlan 11 to 20
stp disable
#
interface g0/0/3
port link-type trunk
port trunk allow-pass vlan 11 to 20
stp disable
#
interface g0/0/4
port link-type trunk
port trunk allow-pass vlan 11 to 20
stp instance 2 cost 200000
#
return