Enabling and configuring MSTP globally

Follow this procedure to configure the Multiple Spanning Tree Protocol.

Procedure

  1. Enter global configuration mode.
    device# configure terminal
    
  2. Enable MSTP.
    device(config)# protocol spanning-tree mstp
    
    This command creates a context for MSTP. MSTP is automatically enabled. All MSTP specific CLI commands can be issued only from this context. Entering no protocol spanning-tree mstp deletes the context and all the configurations defined within the context.
  3. Specify the region name.
    device(config-mstp)# region kerry
    
  4. Specify the revision number.
    device(config-mstp)# revision 1
    
  5. Configure an optional description of the MSTP instance.
    device(config-mstp)# description kerry switches
    
  6. Specify the maximum hops for a BPDU to prevent the messages from looping indefinitely on the interface.
    device(config-mstp)# max-hops 25
    
    Setting this parameter prevents messages from looping indefinitely on the interface. The range is 1 through 40 hops while the default is 20 .
  7. Map VLANs to MSTP instances and set the instance priority.
    1. Map VLANs 7 and 8 to instance 1.
      device(config-mstp)# instance 1 vlan 7,8
      
    2. Map VLANs 21, 22, and 23 to instance 2.
      device(config-mstp)# instance 2 vlan 21-23
      
    3. Set the priority of instance 1.
      device(config-mstp)# instance 1 priority 4096
      
    This command can be used only after the VLAN is created. VLAN instance mapping is removed from the configuration if the underlying VLANs are deleted.
  8. Configure a bridge priority for the CIST bridge.
    device(config-mstp)# bridge-priority 4096
    
    The range is 0 through 61440 in increments of 4096. The default is 32768.
  9. Set the error disable parameters.
    1. Enable the timer to bring the port out of error disable state.
      device(config-mstp)# error-disable-timeout enable
      
    2. Specify the time in seconds it takes for an interface to time out.
      device(config-mstp)# error-disable-timeout interval 60
      
      The range is from 10 to 1000000 seconds with a default of 300 seconds.
  10. Configure forward delay.
    1. Specify the bridge forward delay.
      device(config-mstp)# forward-delay 15
      
    This command allows you to specify how long an interface remains in the listening and learning states before it begins forwarding. This command affects all MSTP instances. The range of values is from 4 to 30 seconds with a default of 15 seconds.
  11. Configure hello time.
    device(config-mstp)# hello-time 2
    
    The hello time determines how often the switch interface broadcasts hello BPDUs to other devices. The range is from 1 through 10 seconds with a default of 2 seconds.
  12. Configure the maximum age.
    device(config-mstp)# max-age 20
    
    You must set the max-age so that it is greater than the hello-time. The range is 6 through 40 seconds with a default of 20 seconds.
  13. Specify the port-channel path cost.
    device(config-mstp)# port-channel path-cost custom
    

    This command allows you to control the path cost of a port channel according to bandwidth.

  14. Specify the transmit hold count.
    device(config-mstp)# transmit-holdcount 5
    
    The transmit hold count is used to limit the maximum number of MSTP BPDUs that the bridge can transmit on a port before pausing for 1 second. The range is from 1 to 10 seconds with a default of 6 seconds.
  15. Configure Cisco interoperability.
    device(config-mstp)# cisco-interoperability enable 
    
    This command enables the ability to interoperate with certain legacy Cisco switches. The default is Cisco interoperability is disabled.
  16. Return to privileged exec mode.
    device(config-mstp)# end
    
  17. Verify the configuration. The following is an example configuration.
    device# show spanning-tree mst-config
    
    Spanning-tree Mode: Multiple Spanning Tree Protocol 
    
     CIST Root Id: 8000.001b.ed9f.1700
     CIST Bridge Id: 8000.768e.f80a.6800
     CIST Reg Root Id: 8000.001b.ed9f.1700
    
     CIST Root Path Cost: 0; CIST Root Port: Eth 1/2
     CIST Root Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 19
     Configured Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20;
     Tx-HoldCount: 6
     Number of topology change(s): 139; Last change occurred 00:03:36 ago on Eth 1/2
    
     Bpdu-guard errdisable timeout: disabled
     Bpdu-guard errdisable timeout interval: 300 sec
     Migrate Time: 3 sec
    
      Name           : kerry
      Revision Level : 1
      Digest         : 0x9357EBB7A8D74DD5FEF4F2BAB50531AA
    
      Instance        VLAN
      --------        ----
       0:             1
       1:             7,8
       2:             21-23
    

    Observe that the settings comply with the formula set out in the STP parameters section, as:

    (2 × (forward delay - 1)) ≥ maximum age ≥ (2 × (hello time + 1))

    or in this case: 28 ≥ 20 ≥ 6.

  18. Save the configuration.
    device# copy running-config startup-config
    

MSTP configuration example

device# configure terminal
device(config)# protocol spanning-tree mstp
device(config-mstp)# region kerry
device(config-mstp)# revision 1
device(config-mstp)# description kerry switches
device(config-mstp)# max-hops 20
device(config-mstp)# instance 1 vlan 7,8
device(config-mstp)# instance 2 vlan 21-23
device(config-mstp)# instance 1 priority 4096
device(config-mstp)# bridge-priority 4096
device(config-mstp)# error-disable-timeout enable
device(config-mstp)# error-disable-timeout interval 60
device(config-mstp)# forward-delay 16
device(config-mstp)# hello-time 5
device(config-mstp)# max-age 16
device(config-mstp)# port-channel path-cost custon
device(config-mstp)# transmit-holdcount 5
device(config-mstp)# cisco-interoperability enable 
device(config-mstp)# end
device# show spanning-tree mst
device# copy running-config startup-config