BuildTheNet

Opening your workspace

Your learning content and tools are loading.

Spanning Tree (STP)

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   P2p

Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.

Useful variants

What each column or field means

FieldMeaning
Spanning tree enabled protocolieee for PVST+ (802.1D), rstp for Rapid PVST+, mstp for MST.
Root ID Priority / AddressThe bridge ID of the root bridge for this VLAN. Lowest priority wins, then lowest MAC.
This bridge is the rootPrinted when this switch is the root. Otherwise you see Cost (the root path cost) and Port (the root port).
Bridge ID … sys-id-extThis switch’s priority. The value shown is the configured priority (a multiple of 4096) plus the VLAN number.
RoleRoot (best path to the root), Desg (designated, forwards toward a segment), Altn (alternate, blocked backup) or Back (backup).
StsFWD forwarding, BLK blocking (802.1D), LRN learning, LIS listening, or BKN broken (for example a type inconsistency).
CostThe port cost. Short-mode defaults are 19 for 100 Mbps and 4 for 1 Gbps; a port-channel gets a lower cost.
Prio.NbrPort 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.
TypeP2p 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

Try it yourself

Learn it in the CCNA path

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.

All 57 commands