show spanning-tree
Shows, per VLAN, the root bridge, this switch’s bridge ID, and every port’s STP role, state and cost.
Written by a working field network engineer · CCNA, Security+, CySA+
Spanning tree’s view of the switch, one block per VLAN. Read the Root ID to learn who won the election, the Bridge ID to see this switch’s own identity, and the port table to see which ports forward and which block.
Example output
SW1#show spanning-tree
VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address 0050.7966.6800
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24586 (priority 24576 sys-id-ext 10)
Address 0050.7966.6800
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p Edge
Fa0/2 Desg FWD 19 128.2 P2p Edge
Gi0/1 Desg FWD 4 128.9 P2p
Po1 Desg FWD 12 128.65 P2pReference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.
Useful variants
show spanning-tree vlan 10show spanning-tree interface Fa0/7show spanning-tree detail
What each column or field means
| Field | Meaning |
|---|---|
Spanning tree enabled protocol | ieee for PVST+ (802.1D), rstp for Rapid PVST+, mstp for MST. |
Root ID Priority / Address | The bridge ID of the root bridge for this VLAN. Lowest priority wins, then lowest MAC. |
This bridge is the root | Printed when this switch is the root. Otherwise you see Cost (the root path cost) and Port (the root port). |
Bridge ID … sys-id-ext | This switch’s priority. The value shown is the configured priority (a multiple of 4096) plus the VLAN number. |
Role | Root (best path to the root), Desg (designated, forwards toward a segment), Altn (alternate, blocked backup) or Back (backup). |
Sts | FWD forwarding, BLK blocking (802.1D), LRN learning, LIS listening, or BKN broken (for example a type inconsistency). |
Cost | The port cost. Short-mode defaults are 19 for 100 Mbps and 4 for 1 Gbps; a port-channel gets a lower cost. |
Prio.Nbr | Port priority (128 by default) and port number. SW1’s eight FastEthernet ports are 1-8, so Gi0/1 is port 9; a port-channel gets a number above the physical ports. |
Type | P2p for full-duplex links, Shr for shared, Edge for PortFast ports. |
When it doesn’t look right
An access switch is the root bridge.
Every switch has the default priority, so the oldest MAC won. Make the core the root with spanning-tree vlan <list> root primary (or priority 24576) and the second core root secondary.
Every redundant port is FWD and the network is melting down.
STP is disabled or a BPDU filter is in the path, so there is a loop. Shut one of the redundant links immediately, then find where BPDUs are being dropped.
A host port takes 30 seconds to come up.
802.1D listening and learning. Enable spanning-tree portfast on edge ports (and BPDU Guard alongside it), or move to Rapid PVST+.
Related commands
- show spanning-tree vlan
- show spanning-tree summary
- show spanning-tree root
- show interfaces trunk
- show mac address-table
Try it yourself
- Spanning-Tree (STP) Basics (free)
- STP Root Bridge Election (free)
- Rapid Spanning-Tree (RSTP) (free)
- Rapid PVST With Deliberate Root Placement (free)
- STP Loop Prevention Repair (Pro)
Learn it in the CCNA path
- Spanning Tree (STP) (2. Network Access)
- STP Roles & States (2. Network Access)
- Read show spanning-tree to find the root and port roles (2. Network Access)
- Pin the root bridge with root primary and secondary (2. Network Access)
Topic
Spanning Tree (STP) — Keep redundant switch links without a Layer 2 loop: root bridge election, port roles and states, Rapid PVST+, PortFast and BPDU Guard.