概念
MSTP: multiple spanning tree protocol
MSTP兼容RSTP和STP,既可以快速收敛,又提供了数据转发的多条冗余链路;数据转发过程中实现vlan数据的
负载均衡
MST 域
Multiple spanning tree region: 由交换网络中多台网络设备及之间的网段构成
MSTI
MST域内可以生成多颗生成树,每颗生成树都称为一个MSTI
每个MSTI 都是相互独立的,且每个MSTI的计算过程和RSTP计算过程是相同的
一个MSTI可以有多个VLAN
一个VLAN只能存在于一个MSTI
每个MSTI都有一个唯一的MSTID
交换机默认MSTI
[SW1]display stp region-configuration 
 Oper configuration
   Format selector    :0             
   Region name        :4c1fcc0928c7             
   Revision level     :0

   Instance   VLANs Mapped
      0       1 to 4094
[SW1] User interface con0 is available
配置方法
[SW1]stp reg	
[SW1]stp region-configuration ?
  <cr>  

[SW1]stp region-configuration   #### 进入配置窗口
[SW1-mst-region]region-name aa  #### 配置域名
[SW1-mst-region]revision-level 1  #### 配置修订号; 域名+修订号,定义一个域
[SW1-mst-region]instance 1 vlan 10 20  #### 实例1 关联 10 20
[SW1-mst-region]instance 2 vlan 30 40  #### 实例2 关联 30 40
[SW1-mst-region]display this           #### 未激活,无法查看配置
#
return
[SW1-mst-region]active region-configuration ?
  <cr>  

[SW1-mst-region]active region-configuration  #### 配置指令激活
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1-mst-region]display  this  #### 激活后方可查看配置
#
stp region-configuration
 region-name aa
 revision-level 1
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
#
return
[SW1-mst-region]
查看某一实例指令
[SW1-mst-region]display stp instance 1
-------[MSTI 1 Global Info]-------
MSTI Bridge ID      :32768.4c1f-cc09-28c7
MSTI RegRoot/IRPC   :32768.4c1f-cc09-28c7 / 0
MSTI RootPortId     :0.0
Master Bridge       :32768.4c1f-cc09-28c7
Cost to Master      :0
TC received         :1
TC count per hello  :0
Time since last TC  :0 days 0h:0m:55s
Number of TC        :4
Last TC occurred    :GigabitEthernet0/0/2
 ----[Port1(GigabitEthernet0/0/1)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000
 Designated Bridge/Port   :32768.4c1f-cc09-28c7 / 128.1
 Port Times          :RemHops 20
 TC or TCN send      :7
 TC or TCN received  :0
 ----[Port2(GigabitEthernet0/0/2)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000
 Designated Bridge/Port   :32768.4c1f-cc09-28c7 / 128.2
 Port Times          :RemHops 20
 TC or TCN send      :1
 TC or TCN received  :1
 ----[Port3(GigabitEthernet0/0/3)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000
 Designated Bridge/Port   :32768.4c1f-cc09-28c7 / 128.3
 Port Times          :RemHops 20
 TC or TCN send      :0
 TC or TCN received  :0
 ----[Port4(GigabitEthernet0/0/4)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000
 Designated Bridge/Port   :32768.4c1f-cc09-28c7 / 128.4
 Port Times          :RemHops 20
 TC or TCN send      :0
 TC or TCN received  :0
查看域配置信息
[SW1]display stp region-configuration 
 Oper configuration
   Format selector    :0             
   Region name        :aa             
   Revision level     :1

   Instance   VLANs Mapped
      0       1 to 9, 11 to 19, 21 to 29, 31 to 39, 41 to 4094
      1       10, 20
      2       30, 40
站在instance 1角度,配置根桥
[SW2]stp priority ?
  INTEGER<0-61440>  Bridge priority, in steps of 4096

[SW2]stp instance 1 ?
  priority  Specify bridge priority
  root      Specify root switch

[SW2]stp instance 1 ro	
[SW2]stp instance 1 root ?
  primary    Primary root switch
  secondary  Secondary root switch

[SW2]stp instance 1 root primary
站在instance1角度,配置secondary
[SW3]stp instance 1 root secondary
查看instance1实例根桥配置
[SW2]display stp instance 1
-------[MSTI 1 Global Info]-------
MSTI Bridge ID      :0.4c1f-ccb4-7d02
MSTI RegRoot/IRPC   :0.4c1f-ccb4-7d02 / 0
MSTI RootPortId     :0.0
MSTI Root Type      :Primary root
Master Bridge       :32768.4c1f-cc09-28c7
Cost to Master      :20000
TC received         :3
TC count per hello  :0
Time since last TC  :0 days 0h:10m:22s
Number of TC        :4
Last TC occurred    :GigabitEthernet0/0/2
 ----[Port2(GigabitEthernet0/0/2)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000
 Designated Bridge/Port   :0.4c1f-ccb4-7d02 / 128.2
 Port Times          :RemHops 20
 TC or TCN send      :2
 TC or TCN received  :3
站在instance2角度,配置根桥
[SW3]stp instance 2 root primary
站在instance2角度,配置secondary
[SW2]stp instance 2 root secondary
查看instance2实例根桥配置
[SW3]display stp instance 2
-------[MSTI 2 Global Info]-------
MSTI Bridge ID      :0.4c1f-cc96-578d
MSTI RegRoot/IRPC   :0.4c1f-cc96-578d / 0
MSTI RootPortId     :0.0
MSTI Root Type      :Primary root
Master Bridge       :32768.4c1f-cc09-28c7
Cost to Master      :20000
TC received         :2
TC count per hello  :0
Time since last TC  :0 days 0h:13m:1s
Number of TC        :4
Last TC occurred    :GigabitEthernet0/0/1
 ----[Port1(GigabitEthernet0/0/1)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000
 Designated Bridge/Port   :0.4c1f-cc96-578d / 128.1
 Port Times          :RemHops 20
 TC or TCN send      :1
 TC or TCN received  :2
 ----[Port2(GigabitEthernet0/0/2)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000
 Designated Bridge/Port   :0.4c1f-cc96-578d / 128.2
 Port Times          :RemHops 20
 TC or TCN send      :3
 TC or TCN received  :0
站在接入层交换机,查看不同实例接口阻塞状态
[SW1]display stp brief
 MSTID  Port                        Role  STP State     Protection
   0    GigabitEthernet0/0/1        DESI  FORWARDING      NONE
   0    GigabitEthernet0/0/2        DESI  FORWARDING      NONE
   0    GigabitEthernet0/0/3        DESI  FORWARDING      NONE
   0    GigabitEthernet0/0/4        DESI  FORWARDING      NONE
   0    GigabitEthernet0/0/5        DESI  FORWARDING      NONE
   0    GigabitEthernet0/0/6        DESI  FORWARDING      NONE
   1    GigabitEthernet0/0/1        ROOT  FORWARDING      NONE
   1    GigabitEthernet0/0/2        ALTE  DISCARDING      NONE
   1    GigabitEthernet0/0/3        DESI  FORWARDING      NONE
   1    GigabitEthernet0/0/4        DESI  FORWARDING      NONE
   2    GigabitEthernet0/0/1        ALTE  DISCARDING      NONE
   2    GigabitEthernet0/0/2        ROOT  FORWARDING      NONE
   2    GigabitEthernet0/0/5        DESI  FORWARDING      NONE
   2    GigabitEthernet0/0/6        DESI  FORWARDING      NONE