Configuring MSTP

Procedure
  1. Set MSTP as the spanning tree mode with the command spanning-tree mode mstp.
  2. Configure the MST region in which the switch resides with the command spanning-tree config-name.
  3. Configure the MST revision number for the MST region in which the switch resides with the command spanning-tree config-revision.
  4. Create a spanning tree instance and assign VLANs to it with the command: spanning-tree instance vlan.
  5. Optionally, set the switch priority with the command spanning-tree priority. The switch compares its priority with the priorities of other switches in the same region to determine the root switch for the region.
  6. Optionally, exclude specific ports from the spanning tree with the command spanning-tree bdpu-filter.
  7. Optionally, set individual port costs with the commands spanning-tree cost and spanning-tree instance cost.
  8. For most deployments, the default values for the following features do not need to be changed. If your deployment requires different settings, change the default values with the indicated command:
    MSTP setting Default value Command to change it
    Forwarding delay 15 seconds spanning-tree forward-delay
    Interval between BPDU packet transmissions when operating as the root bridge. 2 seconds spanning-tree hello-time
    Port priority 8 spanning-tree instance port-priority
    MSTI priority 8 spanning-tree instance priority
    STP link type. Point-to-point (for connecting to a switch, bridge, or end-node ) spanning-tree link-type
    Loop guard Disabled spanning-tree loop-guard
    Maximum age set for BPDU packets transmitted when operating as the root bridge. 20 seconds spanning-tree max-age
    Maximum hops set for BPDU packets transmitted when operating as the root bridge. 20 spanning-tree max-hops
    Port priority 8 (4 for LAGs) spanning-tree port-priority
    Port type administrative network spanning-tree port-type
    Root guard Disabled (port can be selected as the root) spanning-tree root-guard
    Propagate topology changes to other ports. Disabled spanning-tree tcn-guard
    Maximum number of BPDUs that can be sent from an interface 6 per second spanning-tree transmit-hold-count
    Send SNMP traps for new root and topology changes. Disabled spanning-tree trap
  9. Enable spanning tree with the command spanning-tree.
  10. Review MSTP configuration settings with the command show spanning tree.

Example

This example creates the following configuration:

  • Sets the spanning tree mode to mstp.
  • Creates the MST region reg.

  • Sets the MSTP revision number to 1.
  • Creates the spanning tree instance 1 and assigns VLAN 30 to it.
  • Creates the spanning tree instance 2 and assigns VLAN 40 to it.
  • Enables spanning tree.
switch(config)# spanning-tree mode mstp 
switch(config)# spanning-tree config-name reg
switch(config)# spanning-tree config-revision 1
switch(config)# spanning-tree inst 1 vlan 30
switch(config)# spanning-tree inst 2 vlan 40
switch(config)# spanning-tree 
switch(config)# exit
switch# show spanning-tree
Spanning tree status      : Enabled Protocol: MSTP

MST0
  Root ID    Priority   : 32768
             MAC-Address: 48:0f:cf:af:f2:b2
             This bridge is the root
             Hello time(in seconds):2  Max Age(in seconds):20
             Forward Delay(in seconds):15

  Bridge ID  Priority  : 32768
             MAC-Address: 48:0f:cf:af:f2:b2
             Hello time(in seconds):2  Max Age(in seconds):20
             Forward Delay(in seconds):15

Port         Role           State        Cost    Priority   Type
------------ -------------- ------------ ------- ---------- ----------
1/1/1        Designated     Forwarding   20000   128        point_to_point
1/1/2        Designated     Forwarding   20000   128        point_to_point


switch# show spanning-tree mst
#### MST0
Vlans mapped:  1-29,31-39,41-4094
Bridge         Address:48:0f:cf:af:f2:b2    priority:32768
Root
Regional Root
Operational    Hello time(in seconds): 2  Forward delay(in seconds):15  Max-age(in seconds):20  txHoldCount(in pps): 6
Configured     Hello time(in seconds): 2  Forward delay(in seconds):15  Max-age(in seconds):20  Max-Hops:20
Root           Address:48:0f:cf:af:f2:b2  Priority:32768
               Port:0                     Path cost:0
Regional Root  Address:48:0f:cf:af:f2:b2  Priority:32768
               Internal cost:0            Rem Hops:20

Port           Role           State        Cost       Priority   Type
-------------- -------------- ------------ ---------- ---------- ----------
1/1/1          Designated     Forwarding   20000      128        point_to_point
1/1/2          Designated     Forwarding   20000      128        point_to_point


#### MST1
Vlans mapped:  30
Bridge         Address:48:0f:cf:af:f2:b2    Priority:32768
Root           Address:48:0f:cf:af:f2:b2    Priority:32768
               Port:0, Cost:0, Rem Hops:20

Port           Role           State        Cost    Priority   Type
-------------- -------------- ------------ ------- ---------- ----------
1/1/1          Designated     Forwarding   20000   128        point_to_point
1/1/2          Designated     Forwarding   20000   128        point_to_point


#### MST2
Vlans mapped:  40
Bridge         Address:48:0f:cf:af:f2:b2    Priority:32768
Root           Address:48:0f:cf:af:f2:b2    Priority:32768
               Port:0, Cost:0, Rem Hops:20

Port           Role           State        Cost    Priority   Type
-------------- -------------- ------------ ------- ---------- ----------
1/1/1          Designated     Forwarding   20000   128        point_to_point
1/1/2          Designated     Forwarding   20000   128        point_to_point