Enabling and configuring MSTP on an interface

The parameters can be configured individually on an interface by:
  1. Entering the commands in Steps 1 through Step 3 for the target interface
  2. Running the relevant parameter command
  3. Verifying the result
  4. Saving the configuration

For detailed descriptions of the parameters and features, see the sections STP parameters and STP features.

  1. Enter configuration mode.
    device# configure terminal
    
  2. Enable MSTP.
    device(config)# protocol spanning-tree mstp
    
  3. Enter interface configuration mode.
    device(config-mstp)# interface ethernet 0/5 
    
  4. Enable the interface.
    device(conf-if-eth-0/5)# no shutdown
     
  5. Configure the restricted role feature for the port.
    device(conf-if-eth-0/5)# spanning-tree restricted-role
    
    This command keeps a port from becoming a root.
  6. Restrict topology change notifications (TCN) BPDUs for an MSTP instance.
    device(conf-if-eth-0/5)# spanning-tree instance 5 restricted-tcn
    
    This prevents the port from propagating received TCNs and topology changes originating from a bridge, external to the core network, to other ports.
  7. Enable auto detection of an MSTP edge port.
    device(conf-if-eth-0/5)# spanning-tree autoedge
     
    Enabling this feature allows the system to automatically identify the edge port. The port can become an edge port if no BPDU is received. By default, automatic edge detection is disabled.

  8. device(conf-if-eth-0/5)# spanning-tree edgeport
    
    Enabling edge port allows the port to quickly transition to the forwarding state. By default, automatic edge detection is disabled.
  9. Enable BPDU guard on the port
    device(conf-if-eth-0/5)# spanning-tree edgeport bpdu-guard 
    
    BPDU guard removes a node that reflects BPDUs back in the network. It enforces the STP domain borders and keeps the active topology predictable by not allowing any network devices behind a BPDU guard-enabled port to participate in STP.
  10. Set the path cost of a port.
    device(conf-if-eth-0/5)# spanning-tree cost 200000	   
    
    The path cost range is from 1 to 200000000. Leaving the default adjusts path cost relative to changes in the bandwidth. A lower path cost indicates greater likelihood of becoming root port.
  11. Configure the link type.
    device(conf-if-eth-0/5)# spanning-tree link-type point-to-point 
    
    The options are point-to-point or shared.
  12. Enable port priority.
    device(conf-if-eth-0/5)# spanning-tree priority 128
    
    The range is from 0 to 240 in increments of 16 with a default of 32. A lower priority indicates greater likelihood of becoming root port.
  13. Return to privileged exec mode.
    device(conf-if-eth-0/5)# end
    
  14. Verify the configuration.
    device# show spanning-tree interface ethernet 0/5
    
    Spanning-tree Mode: Multiple Spanning Tree Protocol
    
     Root Id: 8000.001b.ed9f.1700
     Bridge Id: 8000.01e0.5200.011d
    
     Port Eth 0/5 enabled
        Ifindex: 411271175; Id: 8002; Role: Designated; State: Forwarding
        Designated External Path Cost: 0; Internal Path Cost: 20000000
        Configured Path Cost: 200000
        Designated Port Id: 8002; Port Priority: 128
        Designated Bridge: 8000.01e0.5200.011d
        Number of forward-transitions: 1
        Version: Multiple Spanning Tree Protocol - Received MSTP - Sent MSTP
        Edgeport: yes; AutoEdge: yes; AdminEdge: no; EdgeDelay: 3 sec
        Restricted-role is enabled
        Restricted-tcn is enabled
        Boundary: no
        Bpdu-guard: on
        Link-type: point-to-point
        Received BPDUs: 86; Sent BPDUs: 1654
    
  15. Save the configuration.
    device# copy running-config startup-config
    

Enable MSTP on an interface configuration example

device# configure terminal
device(config)# protocol spanning-tree mstp
device(config-mstp)# interface ethernet 0/5 
device(conf-if-eth-0/5)# no shutdown
device(conf-if-eth-0/5)# spanning-tree restricted-role
device(conf-if-eth-0/5)# spanning-tree instance 5 restricted-tcn
device(conf-if-eth-0/5)# spanning-tree autoedge
device(conf-if-eth-0/5)# spanning-tree edgeport
device(conf-if-eth-0/5)# spanning-tree edgeport bpdu-guard 
device(conf-if-eth-0/5)# spanning-tree cost 200000	   
device(conf-if-eth-0/5)# spanning-tree link-type point-to-point 
device(conf-if-eth-0/5)# spanning-tree priority 128
device(conf-if-eth-0/5)# end
device# show spanning-tree interface ethernet 0/5
device# copy running-config startup-config