Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Spanning Tree Protocol Reference

Direct answer

Spanning tree keeps a switched network free of loops: the switches elect one root bridge, and every redundant path towards it is blocked until needed.

When to use this

Start here for a broadcast storm, a link that stays blocked, slow convergence after a change, or to check that the intended switch is root.

First 30 seconds

1. show spanning-tree vlan <id> — which switch is root? The intended one?

2. This switch's root port — the expected uplink?

3. Any port blocking that should forward, or forwarding where a loop exists?

4. show spanning-tree detail | include changes|from — count rising? From which port?

5. show spanning-tree inconsistentports and err-disabled ports.

Operational verification

intended root has the lowest priority → BPDUs received on every uplink → one root port per switch → one designated port per segment → remaining ports blocking → topology changes rare

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol behaviour per standard; Cisco IOS / IOS XE command examples.Cisco IOS / IOS XE
Applicability is projected only from persisted Topic profile and Command metadata.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol behaviour per standard; Cisco IOS / IOS XE command examples. · Cisco IOS / IOS XE
Key commandshow spanning-tree blockedports
Scope / prerequisiteStart here for a broadcast storm, a link that stays blocked, slow convergence after a change, or to check that the inte…
Show · 1
What next?2 suggested next steps
Child topics (this level)11
Catalog command links1
Evidence0
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

Command lookup Jump straight to Cisco syntax
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic STP / RSTP / MST Reference

Spanning Tree protocols prevent Layer-2 loops by electing a root and placing redundant paths into non-forwarding roles/states.

Subtopic STP Guard Features Reference

BPDU Guard, Root Guard, Loop Guard and related protections constrain how switchports participate in spanning tree.

Subtopic STP Root & Port Election Deep Reference

STP selects a root bridge then derives root, designated and alternate/blocking roles using a deterministic sequence of path-cost and bridge/port tie-breakers.

Subtopic RSTP Proposal / Agreement Deep Reference

RSTP accelerates convergence on point-to-point links using proposal/agreement synchronization instead of relying solely on classic STP forward-delay transitions.

Subtopic MST Region & Instance Deep Reference

Multiple Spanning Tree maps many VLANs into a smaller number of spanning-tree instances and requires matching region parameters between switches.

Subtopic BPDU Guard Deep Reference

BPDU Guard protects edge/PortFast-style ports by taking action when BPDUs are received where a switch-to-switch topology is not expected.

Subtopic Root Guard Deep Reference

Root Guard protects a designated port from accepting a superior BPDU that would make the downstream side influence the intended STP root placement.

Subtopic Loop Guard Deep Reference

Loop Guard protects non-designated STP ports from incorrectly transitioning toward forwarding when expected BPDUs disappear on a unidirectional or control-plane-failure path.

Subtopic STP / RSTP BPDU Field Reference

STP and RSTP BPDUs carry root information, sender bridge/port identity, path cost, timers and flags that drive topology decisions.

Subtopic STP/RSTP Flag Reference

BPDU flags carry topology-change and RSTP proposal/agreement/role/learning/forwarding state.

Subtopic MST BPDU Field Reference

MST BPDUs extend RSTP information with region identity, digest and per-instance records.

Key points

Set the root on purpose with a low priority; otherwise the oldest switch may win. Every switch has one root port; every segment one designated port; the rest block. PortFast and BPDU guard belong on access ports only. Constant topology changes flush MAC tables.

Key checks
  • show spanning-tree vlan <id> — root bridge, this switch's priority, role and state of each port.
  • show spanning-tree root — root and root port per VLAN.
  • show spanning-tree summary — mode and enabled features.
  • show spanning-tree detail | include changes|from — topology change count and source.
  • show spanning-tree inconsistentports — ports blocked by root guard or loop guard.
ReferenceWhat it is1 section · depth on demand
ReferenceImportant terms & boundaries3 sections · depth on demand

Where to look

QuestionReference
Why is this switch the root?*STP Root & Port Election Deep Reference*
Why is a port blocking?*STP / RSTP / MST Reference*
Why did RSTP converge slowly?*RSTP Proposal / Agreement Deep Reference*
Why do MST regions not match?*MST Region & Instance Deep Reference*
Why was a port err-disabled by BPDU Guard?*BPDU Guard Deep Reference*
What do the BPDU flags mean?*STP/RSTP Flag Reference*

Spanning Tree keeps a switched network with redundant links free of loops by blocking just enough ports to leave a single active path, and unblocking them when a link fails. Its behaviour depends on which switch is elected root, so a stable network sets the root deliberately and protects edge ports against unexpected switches. Frequent topology changes are the warning sign to watch for, because each one briefly floods traffic across the network.

Spanning Tree quick reference:

show spanning-tree vlan 20
show spanning-tree summary
show spanning-tree detail | include ieee|occurr|from|is exec
spanning-tree mode rapid-pvst
spanning-tree vlan 1-4094 root primary
spanning-tree portfast default
spanning-tree portfast bpduguard default

Set root bridges deliberately (distribution/core), use PortFast + BPDU Guard on edge ports, and investigate frequent topology changes — they flush MAC tables and cause flooding.

Key numbers

ItemValue
Default bridge priority32768 (+ VLAN ID with PVST)
Hello / Max age / Forward delay2 / 20 / 15 s
RSTP port rolesRoot, designated, alternate, backup
MST instances (Catalyst)Up to 65, including MST0 (IST)

In depth

Spanning Tree Protocol keeps redundant Layer 2 topologies loop-free by electing a root bridge, choosing one forwarding path from every switch towards it, and blocking the rest. Without it, a single redundant link causes broadcast storms and MAC table instability within seconds.

VariantNote
802.1D (classic)Slow, 30–50 s convergence
RSTP / Rapid PVST+Rapid convergence, per-VLAN on Cisco
MSTMany VLANs mapped to few instances

Good STP practice: choose the root deliberately, use PortFast with BPDU Guard on edge ports, and Root/Loop Guard where topology must be protected.

Confirmation

Confirm action

Continue?