Use it to understand which links are blocked and why, to place the root deliberately, and when users wait for a link or the network floods after a change.
STP / RSTP / MST Reference
Spanning tree prevents loops in a switched network with redundant links: the switches elect a root, each keeps its best path to it, and the remaining redundant ports are blocked. STP, RSTP and MST differ in how fast they react and how many trees they run.
Spanning tree checks
Cisco IOS / IOS XE (PVST+, Rapid PVST+, MST). Confirm the mode first with show spanning-tree summary.
| Observed state | Possible cause | Command | Observation and next check |
|---|---|---|---|
| Unexpected root bridge | A switch with lower priority or MAC wins the election | show spanning-tree vlan <vlan-id> | Root ID matches the intended switch, or the intended switch reports that it is the root. Next: Set spanning-tree vlan <vlan-id> priority (or root primary) on the intended root. |
| Port blocking (BLK / ALTN) | Normal loop prevention, or a cost or priority choosing an unexpected path | show spanning-tree vlan <vlan-id> | Alternate or backup role with state BLK is expected on redundant links. Next: Compare root port and path cost; change cost or priority only if the chosen path is wrong. |
| Port err-disabled | BPDU guard saw a BPDU on a PortFast edge port | show interfaces status err-disabled | Reason bpduguard for the port. Next: Remove the switch or loop on that port, then shutdown / no shutdown or use errdisable recovery. |
| Frequent topology changes | Host ports without PortFast, or a flapping link | show spanning-tree vlan <vlan-id> detail | Number of topology changes, time of the last change and the interface it came from. Next: Investigate that interface; enable PortFast on host-facing access ports. |
| Root or loop inconsistent port | Root guard received a superior BPDU, or loop guard stopped receiving BPDUs | show spanning-tree inconsistentports | The port and the inconsistency type. Next: Find why superior BPDUs arrive, or check for a unidirectional link. |
Example output and interpretation
Illustrative output · not captured Evidence
Switch# show spanning-tree vlan 10
VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address 0011.2233.4455
Cost 4
Port 1 (GigabitEthernet1/0/1)
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- ----
Gi1/0/1 Root FWD 4 128.1 P2p
Gi1/0/2 Altn BLK 4 128.2 P2pIllustrative output: Gi1/0/2 is an alternate port, blocking because Gi1/0/1 already leads to the root. That is expected on a redundant uplink; it is not a fault by itself.
Technical sources
Detailed reference and supporting material
Additional explanation, verification and reference tables.
Operational reference
Fast context before you go deeper.
1. show spanning-tree vlan <id> — is the root the switch you intended?
2. Which port is the root port, and which are blocked (Altn)?
3. Mode rapid on every switch? show spanning-tree summary.
4. End-device ports shown as Edge?
5. Topology change counter stable?
mode consistent across switches → intended root elected per VLAN → root port = intended uplink on each switch → redundant ports blocked → edge ports on end devices → topology change count stable
Context & applicabilityCommon mistakes · platform/version boundaries
Additional verification procedures
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Typical faults & boundaries Narrow the fault
- An access switch has become root. Nobody set the priority; the oldest switch, with the lowest MAC address, won. Set the root deliberately with
spanning-tree vlan <id> root primaryon the core. - Traffic takes a long path. The root is in the wrong place, so the "wrong" links are blocked.
- A port is blocked and assumed faulty. A blocked redundant port is spanning tree working.
- Users wait 30 seconds for a link. The port is not an edge port, or the switch runs classic STP.
- MAC tables are flushed constantly. Topology changes from ports to end devices that are not edge ports.
- A broadcast storm in spite of spanning tree. BPDUs are filtered somewhere, or a link passes traffic in one direction only.
- Slow convergence in a rapid network. One switch still runs classic STP, and its neighbours fall back to timers on those ports.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
A blocked redundant port is spanning tree working. Set the root on purpose — otherwise the switch with the lowest MAC address wins. Run a rapid mode everywhere, and make ports to end devices edge ports with spanning-tree portfast.
show spanning-tree summary— the mode in use.show spanning-tree vlan <id>— root, this switch's root port, and each port's role and state.show spanning-tree root— root and root port for every VLAN.show spanning-tree vlan <id> detail | include changes|from— topology changes and where the last one came from.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
Spanning tree stops loops in a switched network that has redundant links. The switches elect one root bridge, each keeps its best path towards it, and the remaining redundant ports are blocked. Three generations exist — STP, RSTP and MST — which differ in how fast they react and in how many separate trees they calculate.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
Ethernet frames carry no hop limit. A loop makes broadcasts circulate and multiply until the affected VLAN, and often the switches' CPUs, are unusable. Spanning tree is what makes it safe to have a second uplink — and its choice of root and blocked ports decides which path traffic actually takes.
ReferenceHow it works1 section · depth on demand
How it works
| STP (802.1D) | RSTP (802.1w) | MST (802.1s) | |
|---|---|---|---|
| Reaction to a change | 30–50 seconds, timer-based | Usually under a second, by handshake between neighbours | As RSTP |
| Trees | One | One | One per instance; several VLANs share an instance |
| Cisco mode | pvst — one STP tree per VLAN | rapid-pvst — one RSTP tree per VLAN | mst |
Cisco switches run a per-VLAN variant by default, so each VLAN has its own root and its own blocked ports. That allows different VLANs to use different uplinks, at the cost of one calculation per VLAN. MST groups VLANs into a few instances to reduce that load. The mode is set with spanning-tree mode.
All three work the same way underneath:
1. The switch with the lowest bridge ID — priority, then MAC address — becomes root.
2. Every other switch picks one root port: the port with the lowest cost path to the root.
3. On every link, one side becomes the designated port — the one offering the better path to the root.
4. A port that is neither is blocked: an alternate port, kept ready as a backup.
Classic STP moves a port through listening and learning for 15 seconds each before it forwards. RSTP has three states — discarding, learning, forwarding — and replaces the waiting with a direct agreement between the two switches on a link.
Ports towards end devices should be configured as edge ports (spanning-tree portfast) so they forward at once and do not signal a topology change every time a PC starts.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Choosing and running STP, RSTP and MST on Cisco IOS XE
The spanning-tree mode decides how many trees run and how fast they converge. Pick it once per Layer 2 domain.
Modes on Catalyst 9300
The STP guide gives Rapid PVST+ as the default, with PVST+ and MST available. Only one mode runs at a time (MST guide).
| Mode | Standard basis | Trees | Convergence |
|---|---|---|---|
| PVST+ | 802.1D per VLAN (Cisco) | One per VLAN | Timer-based, 30–50 s |
| Rapid PVST+ | 802.1w per VLAN (Cisco) | One per VLAN | Proposal/agreement, sub-second to a few seconds |
| MST | 802.1s (now in 802.1Q) | One per instance, up to 65 per region | Same mechanism as RSTP |
Cisco's RSTP document lists the core RSTP changes: three port states, alternate and backup roles, BPDUs as keepalives every hello time, failure detection after three missed hellos, and the proposal/agreement handshake.
C9300(config)# spanning-tree mode rapid-pvst
C9300# show spanning-tree summary
Switch is in rapid-pvst mode
Root bridge for: VLAN0010, VLAN0020
EtherChannel misconfig guard is enabled
Extended system ID is enabled
Portfast Default is enabled
PortFast BPDU Guard Default is enabled
Loopguard Default is enabled
Pathcost method used is short
Choosing a mode
| Situation | Choice |
|---|---|
| Cisco-only campus, moderate VLAN count | Rapid PVST+ (default) |
| Hundreds of VLANs, or many trunks per switch | MST: fewer trees, fewer BPDUs |
| Mixed vendors | MST or RSTP (standards-based) |
| New designs | Minimise Layer 2 loops: routed access, or EtherChannel to stacked/StackWise Virtual pairs |
Timers (STP guide defaults)
| Timer | Default |
|---|---|
| Hello | 2 s |
| Forward delay | 15 s |
| Max age | 20 s |
| Transmit hold count | 6 BPDUs |
Leave the timers at their defaults. RSTP and MST converge through handshakes, not timers, and wrong timers can cause loops.
Mode migration
Changing the mode restarts spanning tree on the switch and interrupts traffic. Migrate PVST+ → Rapid PVST+ switch by switch from the edge inwards. For MST, prepare the region configuration first and enable spanning-tree mode mst region by region.
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → STP / RSTP / MST Reference. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
STP / RSTP Fast Check
Root, role and state lookup.
Fast checks
show spanning-tree root
show spanning-tree vlan <id>
show spanning-tree detail
show spanning-tree inconsistentports
Read in order: Root → root port → designated/alternate roles → forwarding/discarding → topology changes.
A blocked/discarding redundant link can be healthy.