Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

STP / RSTP / MST Reference

Direct answer

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.

First checks

Spanning tree checks

Cisco IOS / IOS XE (PVST+, Rapid PVST+, MST). Confirm the mode first with show spanning-tree summary.

Observed statePossible causeCommandObservation and next check
Unexpected root bridgeA switch with lower priority or MAC wins the electionshow 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 pathshow 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-disabledBPDU guard saw a BPDU on a PortFast edge portshow 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 changesHost ports without PortFast, or a flapping linkshow 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 portRoot guard received a superior BPDU, or loop guard stopped receiving BPDUsshow 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    P2p

Illustrative 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
    Command lookup Jump straight to Cisco syntax
    Detailed reference and supporting material

    Additional explanation, verification and reference tables.

    At a glance

    Operational reference

    Fast context before you go deeper.

    PlatformCisco IOS / IOS XE
    Verificationmode consistent across switches → intended root elected per VLAN → root port = intended uplink on each switch → redundant ports blocked → e…
    Scope / prerequisiteUse it to understand which links are blocked and why, to place the root deliberately, and when users wait for a link or…
    What next?3 suggested next steps
    Evidence1
    On this pageJump to a specific section
    When to use this

    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.

    First 30 seconds

    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?

    Operational verification

    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
    Platform / version applicability
    Cisco IOS / IOS XE
    applies
    Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
    Additional verification procedures
    Operational workflow

    Verification & Troubleshooting

    Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

    1 steps Observe → verify → isolate → change minimally → repeat the original test.
    ObservedRecord what the original test actually shows

    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 primary on 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 references

    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.

    observation · 1
    Key points

    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.

    Key checks
    • 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 change30–50 seconds, timer-basedUsually under a second, by handshake between neighboursAs RSTP
    TreesOneOneOne per instance; several VLANs share an instance
    Cisco modepvst — one STP tree per VLANrapid-pvst — one RSTP tree per VLANmst

    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).

    ModeStandard basisTreesConvergence
    PVST+802.1D per VLAN (Cisco)One per VLANTimer-based, 30–50 s
    Rapid PVST+802.1w per VLAN (Cisco)One per VLANProposal/agreement, sub-second to a few seconds
    MST802.1s (now in 802.1Q)One per instance, up to 65 per regionSame 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

    SituationChoice
    Cisco-only campus, moderate VLAN countRapid PVST+ (default)
    Hundreds of VLANs, or many trunks per switchMST: fewer trees, fewer BPDUs
    Mixed vendorsMST or RSTP (standards-based)
    New designsMinimise Layer 2 loops: routed access, or EtherChannel to stacked/StackWise Virtual pairs

    Timers (STP guide defaults)

    TimerDefault
    Hello2 s
    Forward delay15 s
    Max age20 s
    Transmit hold count6 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.

    Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
    Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
    Technical verification history

    Verification history & basis

    When and against what this Topic was checked. Later text edits do not count as a new check.

    2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

    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%
    Technical changelog & impact

    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.

    Terminology layer

    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.

    Aliases that resolve here
    stprstpmstspanning treeroot bridge
    Embedded quick reference

    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.

    Confirmation

    Confirm action

    Continue?