Follow these steps to configure RSTP on an Ethernet interface.
For detailed descriptions of the parameters and features, see the sections STP parameters and STP features.
device# configure terminal
device(config)# interface ethernet 0/10
device(conf-if-eth-0/10)# no 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
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.
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.
device(conf-if-eth-0/10)# spanning-tree link-type point-to-point
Note
The link type is explicitly configured as point-to-point rather than shared.device(conf-if-eth-0/10)# end
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
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.
device# copy running-config startup-config
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