Enabling and configuring RSTP on an interface

Follow these steps to configure RSTP on an Ethernet interface.

About this task

You can configure the parameters individually on an interface by doing the following:
  1. Entering the commands in Steps 1 through 3.
  2. Specifying additional parameters, as appropriate.
  3. Verifying the result.
  4. Saving the configuration.

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

Procedure

  1. Enter global configuration mode.
    device# configure terminal
    
  2. Enter interface subtype configuration mode.
    device(config)# interface ethernet 0/10
    
  3. Enable the interface.
    device(conf-if-eth-0/10)# no shutdown
    
    To disable the spanning tree on the interface you use the spanning-tree shutdown command.
  4. Specify the port priority on the interface.
    device(conf-if-eth-0/10)# spanning-tree priority 128
    
    The range is from 0 through 240 in increments of 16. The default value is 128.
  5. Specify the path cost on the interface.
    device(conf-if-eth-0/10)# spanning-tree cost 20000000
    
    The lower the path cost means a greater chance that the interface becomes the root port. The range is 1 through 200000000. The default path cost is assigned as per the port speed.
  6. Enable edge port.
    device(conf-if-eth-0/10)# spanning-tree edgeport
    
    If BPDUs are received on a port fast enabled interface, the interface loses the edge port status unless it receives a shutdown or no shutdown command.
  7. Enable BPDU guard on the interface.
    device(conf-if-eth-0/10)# 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.
  8. Enable automatic edge detection on the interface.
    device(conf-if-eth-0/10)# spanning-tree autoedge
    

    You use this command to automatically identify the edge port. A port becomes an edge port if it receives no BPDUs. By default, automatic edge detection is disabled.

  9. Enable root guard on the interface.
    device(conf-if-eth-0/10)# spanning-tree guard root
    

    Root guard protects the root bridge from malicious attacks and unintentional misconfigurations where a bridge device that is not intended to be the root bridge becomes the root bridge.

  10. Specify a link type on the interface.
    device(conf-if-eth-0/10)# spanning-tree link-type point-to-point
    
    Note

    Note

    The link type is explicitly configured as point-to-point rather than shared.
  11. Return to privileged EXEC mode.
    device(conf-if-eth-0/10)# end
    
  12. Verify the configuration.
    device# show spanning-tree 
    
     Spanning-tree Mode: Rapid Spanning Tree Protocol
    
     Root Id: 8000.01e0.5200.0180 (self)
     Bridge Id: 8000.01e0.5200.0180
    
     Root Bridge Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Configured Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Number of topology change(s): 0
    
     Bpdu-guard errdisable timeout: enabled
     Bpdu-guard errdisable timeout interval: 60 sec
    
    
     Port Eth 0/10 enabled
        Ifindex: 201359360; Id: 8002; Role: Disabled; State: Disabled
        Designated Path Cost: 0
        Configured Path Cost: 20000000
        Designated Port Id: 0; Port Priority: 128
        Designated Bridge: 0000.0000.0000.0000
        Number of forward-transitions: 0
        Version: Spanning Tree Protocol - Received None - Sent STP
        Edgeport: on; AutoEdge: yes; AdminEdge: no; EdgeDelay: 3 sec
        Configured Root guard: on; Operational Root guard: on
        Bpdu-guard: on
        Link-type: point-to-point
        Received BPDUs: 0; Sent BPDUs: 0 
    
    Interface   Role     Sts     Cost       Prio     Link-type     Edge
    ---------------------------------------------------------------------
    Eth 0/10    DES      FWD     20000000   128      P2P           No
    
    The forward-delay, hello-time, and max-age parameters are set globally, not on the interface.

    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.

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

RSTP on an interface configuration example

device# configure terminal
device(config)# interface ethernet 0/10
device(conf-if-eth-0/10)# no spanning-tree shutdown
device(conf-if-eth-0/10)# spanning-tree priority 128
device(conf-if-eth-0/10)# spanning-tree cost 20000000
device(conf-if-eth-0/10)# spanning-tree edgeport
device(conf-if-eth-0/10)# spanning-tree edgeport bpdu-guard
device(conf-if-eth-0/10)# spanning-tree autoedge
device(conf-if-eth-0/10)# spanning-tree guard root
device(conf-if-eth-0/10)# spanning-tree link-type point-to-point
device(conf-if-eth-0/10)# end
device# show spanning-tree 
device# copy running-config startup-config