Courseiva
Spanning TreePrivileged EXEC

show spanning-tree detail

Displays detailed Spanning Tree Protocol (STP) information for all VLANs or a specific VLAN, including port roles, states, timers, and bridge IDs, used for troubleshooting STP convergence and topology changes.

Definition: show spanning-tree detail is a Cisco IOS privileged exec command. Displays detailed Spanning Tree Protocol (STP) information for all VLANs or a specific VLAN, including port roles, states, timers, and bridge IDs, used for troubleshooting STP convergence and topology changes.

Overview

The 'show spanning-tree detail' command is a powerful diagnostic tool in Cisco IOS that provides an exhaustive view of the Spanning Tree Protocol (STP) operation on a per-VLAN or per-port basis. It is essential for network engineers troubleshooting STP convergence issues, topology changes, or unexpected blocking states. STP is a Layer 2 protocol that prevents loops in Ethernet networks by creating a loop-free logical topology.

The command displays detailed information such as bridge ID, root ID, port roles (root, designated, alternate, backup), port states (forwarding, blocking, listening, learning), timers (hello, forward delay, max age), and topology change counters. This granularity helps identify why a specific port is not forwarding, whether the root bridge is correctly elected, or if there are frequent topology changes impacting network stability. Unlike 'show spanning-tree' which gives a summary, the detail variant reveals per-port timers, designated bridge details, and the number of topology changes.

It is typically used in the troubleshooting workflow after initial connectivity issues are observed, such as intermittent connectivity or high CPU utilization due to STP recalculations. The command does not alter the running configuration and requires privileged EXEC mode (enable). Output can be lengthy, especially in large VLAN environments, so it is often filtered with 'include' or 'section' commands.

Understanding the output is critical for CCNA and CCNP candidates as STP misconfigurations are common in real-world networks.

Syntax·Privileged EXEC
show spanning-tree detail

When to Use This Command

  • Verify the root bridge and port roles after a network change to ensure proper STP convergence.
  • Troubleshoot a loop or connectivity issue by checking port states (e.g., blocking vs forwarding) and timers.
  • Monitor topology change notifications (TCNs) to identify flapping links or unstable STP topology.
  • Audit STP parameters like bridge priority, hello time, and max age for compliance with network design.

Parameters

ParameterSyntaxDescription
vlan<1-4094>Specifies a single VLAN ID to display detailed STP information for that VLAN only. If omitted, the command shows details for all active VLANs. Common mistake: using a VLAN ID that does not exist or is not configured on the switch, which results in no output.
interfaceinterface-type interface-numberDisplays detailed STP information for a specific interface, such as GigabitEthernet0/1. This is useful for focusing on a particular port's role, state, and timers. Common mistake: specifying an interface that is not in the VLAN or is administratively down, which may show no STP details.

Command Examples

Show spanning-tree detail for all VLANs

show spanning-tree detail
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0011.2233.4455
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0011.2233.4455
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/0            Desg FWD 4         128.1    P2p
Gi0/1            Desg FWD 4         128.2    P2p
Gi0/2            Desg FWD 4         128.3    P2p
Gi0/3            Desg FWD 4         128.4    P2p

VLAN0002
  Spanning tree enabled protocol ieee
  Root ID    Priority    32770
             Address     0011.2233.4455
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32770  (priority 32768 sys-id-ext 2)
             Address     0011.2233.4455
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/0            Desg FWD 4         128.1    P2p
Gi0/1            Desg FWD 4         128.2    P2p
Gi0/2            Desg FWD 4         128.3    P2p
Gi0/3            Desg FWD 4         128.4    P2p

VLAN0001: Shows STP is enabled with IEEE 802.1D. Root ID: priority 32769 (32768+1), MAC 0011.2233.4455, and 'This bridge is the root' indicates this switch is root. Bridge ID: same as root (since it's root). Timers: Hello 2s, Max Age 20s, Forward Delay 15s. Interface table: Gi0/0-3 are all designated (Desg) and forwarding (FWD), cost 4 (1 Gbps), port priority 128, type P2p. VLAN0002: Similar but sys-id-ext 2 (priority 32770). All ports are designated forwarding.

Show spanning-tree detail for a specific VLAN

show spanning-tree vlan 10 detail
VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    32778
             Address     00a3.d1e2.f3c4
             Cost        4
             Port        1 (GigabitEthernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    49162  (priority 49152 sys-id-ext 10)
             Address     0011.2233.4455
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/0            Root FWD 4         128.1    P2p
Gi0/1            Altn BLK 4         128.2    P2p
Gi0/2            Desg FWD 4         128.3    P2p

VLAN0010: Root ID shows priority 32778 (32768+10), MAC 00a3.d1e2.f3c4, cost 4 to root, via port Gi0/0. This switch is not root (Bridge ID different). Bridge ID priority 49162 (49152+10). Interface table: Gi0/0 is Root port (Root) and forwarding (FWD). Gi0/1 is Alternate (Altn) and blocking (BLK) — this is the backup path. Gi0/2 is Designated (Desg) and forwarding. Cost 4 for all (1 Gbps).

Understanding the Output

The output is organized per VLAN. The 'Root ID' section shows the root bridge's priority (including VLAN ID offset), MAC address, and if this switch is the root. If not root, it shows cost to root and the root port.

'Bridge ID' shows this switch's priority and MAC. Timers (Hello, Max Age, Forward Delay) are displayed. The interface table lists each port with Role (Root, Designated, Alternate, Backup), State (FWD=Forwarding, BLK=Blocking, LIS=Listening, LRN=Learning), Cost (path cost to root), Prio.Nbr (port priority and number), and Type (P2p=point-to-point, Shr=shared).

Good values: Root ports and Designated ports should be FWD; Alternate/Backup should be BLK. Watch for unexpected blocking ports or high cost values that may indicate suboptimal paths. Topology changes are not shown in this command; use 'show spanning-tree detail' to see TCN counters if needed.

Configuration Scenarios

Verify Root Bridge Election and Port Roles in a Redundant Topology

A network engineer needs to confirm that the intended root bridge is elected and that all ports are in the correct STP roles (root, designated, alternate) in a topology with two switches connected by two redundant links.

Topology

SW1(Gi0/1)---Gi0/1(SW2) SW1(Gi0/2)---Gi0/2(SW2)

Steps

  1. 1.Step 1: Enter privileged EXEC mode on SW1: enable
  2. 2.Step 2: Run 'show spanning-tree detail' to see detailed STP info for all VLANs.
  3. 3.Step 3: Look for the 'Root ID' section to confirm SW1 is not the root (if SW2 has lower priority).
  4. 4.Step 4: Check each interface's role and state. For example, Gi0/1 should be 'Root' and forwarding, Gi0/2 should be 'Alternate' and blocking.
  5. 5.Step 5: Verify timers: hello time 2 sec, forward delay 15 sec, max age 20 sec.
Configuration
! No configuration needed; this is a verification step.
! However, to set bridge priority on SW2:
SW2(config)# spanning-tree vlan 1 priority 4096

Verify: SW1# show spanning-tree detail vlan 1 Root ID: Priority 4097, Address aaaa.bbbb.cccc Bridge ID: Priority 32769, Address aaaa.bbbb.dddd Interface Gi0/1: Role Root, State Forwarding Interface Gi0/2: Role Alternate, State Blocking

Watch out: If both ports show as designated, the switches might be using Per-VLAN Spanning Tree Plus (PVST+) and the root bridge election may be influenced by VLAN priorities. Ensure the root bridge priority is set correctly.

Troubleshoot a Port Stuck in Blocking State

A user reports that a host connected to a switch port cannot communicate. The engineer suspects STP is blocking the port due to a loop or misconfiguration.

Topology

SW1(Gi0/1)---Host SW1(Gi0/2)---SW2(Gi0/1)

Steps

  1. 1.Step 1: Enter privileged EXEC mode on SW1: enable
  2. 2.Step 2: Run 'show spanning-tree detail interface gigabitethernet0/1' to see STP details for the host port.
  3. 3.Step 3: Observe the port role and state. If it shows 'Alternate' or 'Backup' and 'Blocking', the port is not forwarding.
  4. 4.Step 4: Check the 'Designated Bridge' field to see which switch is the designated bridge for that segment.
  5. 5.Step 5: If the port is an alternate port, it means another switch is providing a redundant path. If it should be forwarding, check for a loop or adjust STP costs.
Configuration
! To force a port to be a designated port (if appropriate), adjust cost or priority:
SW1(config)# interface gigabitethernet0/1
SW1(config-if)# spanning-tree cost 4

Verify: SW1# show spanning-tree detail interface gigabitethernet0/1 Port 1 (GigabitEthernet0/1) of VLAN0001 is forwarding Port path cost 4, Port priority 128, Port identifier 128.1 Designated bridge has priority 32769, address aaaa.bbbb.dddd Designated port id is 128.1, designated path cost 0 Timers: message age 0, forward delay 0, hold 0 Number of transitions to forwarding state: 1 BPDU: sent 10, received 0

Watch out: If the port is an alternate port but should be forwarding, check if the other switch has a lower bridge ID or if the port cost is too high. Also, ensure PortFast is enabled on access ports to avoid listening/learning delays.

Troubleshooting with This Command

When troubleshooting STP issues, the 'show spanning-tree detail' command is invaluable. Healthy output shows a single root bridge with all non-root ports in either root or designated roles, and alternate/backup ports in blocking state. Problem indicators include multiple root bridges (indicates a bridging loop or misconfiguration), ports flapping between states, high topology change counts, or ports stuck in listening/learning.

Focus on the 'Root ID' and 'Bridge ID' fields to verify the root bridge election. The 'Number of topology changes' counter should be low; frequent increments suggest instability. The 'Time since last topology change' helps correlate with network events.

A step-by-step diagnostic flow: 1) Check the root bridge identity. 2) For each VLAN, verify that the root port on non-root switches is correct. 3) Examine port roles and states; any port that is not forwarding when it should be (e.g., a designated port on an access link) needs investigation. 4) Look at the 'Designated Bridge' and 'Designated Port' fields to understand the STP decision path. 5) Check timers: if forward delay is too high, convergence is slow. Correlate with 'show spanning-tree' for a summary, and use 'debug spanning-tree events' for real-time changes. Common symptoms: a) All ports are blocking – possible loop or BPDU guard. b) High CPU due to STP recalculations – check for flapping links or duplex mismatches. c) Intermittent connectivity – look for ports transitioning between states.

The command also helps identify misconfigurations like incorrect bridge priority or path cost.

CCNA Exam Tips

1.

CCNA exam tip: The root bridge is identified by the lowest bridge ID (priority + MAC). If all priorities are equal, the lowest MAC wins.

2.

CCNA exam tip: Port roles: Root port is the best path to root; Designated port is the best path from a segment; Alternate/Backup ports are blocking.

3.

CCNA exam tip: Port states: Blocking (20s) -> Listening (15s) -> Learning (15s) -> Forwarding. Know the timers and that Forward Delay is 15s by default.

4.

CCNA exam tip: The 'show spanning-tree detail' command shows per-VLAN STP info. For PVST+, each VLAN has its own STP instance.

Common Mistakes

Mistake 1: Assuming all ports should be forwarding. In a stable STP topology, some ports must be blocking to prevent loops.

Mistake 2: Forgetting that STP timers (Hello, Max Age, Forward Delay) must be consistent across all switches in the same VLAN to avoid convergence issues.

Mistake 3: Misinterpreting 'This bridge is the root' — if multiple switches claim to be root, there is a misconfiguration (e.g., different VLANs or priority mismatch).

show spanning-tree detail vs show spanning-tree

Both commands display Spanning Tree Protocol information, but 'show spanning-tree detail' provides a verbose per-interface breakdown including timers and topology changes, whereas 'show spanning-tree' gives a concise summary per VLAN. They are often confused because they share the same base command syntax and both operate in privileged EXEC mode.

Aspectshow spanning-tree detailshow spanning-tree
Detail levelFull per-port details, timers, BPDU countersSummary per-VLAN: root, role, state, cost
Output lengthLong, one block per interfaceShort, one line per VLAN or port
Timers displayedHello, forward delay, max age, age timerOnly hello, forward delay, max age (global)
Topology change infoCounts, last change, path cost changesNot included
Typical use caseTroubleshooting slow convergence or flapping portsQuickly verifying root bridge and port roles

Use show spanning-tree detail when you need in-depth per-interface STP state, timers, and topology change history for diagnosing convergence issues.

Use show spanning-tree when you want a fast overview of root bridge, port roles, and per-VLAN spanning tree status.

Platform Notes

In IOS-XE (e.g., Catalyst 3650/3850), the command syntax and output are nearly identical to classic IOS, but the output may include additional fields like 'OperEdge' (Operational Edge) for RSTP edge ports. The NX-OS equivalent is 'show spanning-tree detail' as well, but NX-OS uses a different default STP mode (RPVST+). On NX-OS, the output format is similar but may have slight differences in field names (e.g., 'Port Role' vs 'Role').

For ASA firewalls, STP is not typically used on routed interfaces, but on bridge groups, the command 'show bridge-group' or 'show spanning-tree' may be available in transparent firewall mode. In IOS-XR, STP is not supported; instead, it uses Ethernet VPN (EVPN) or other loop prevention mechanisms. Between IOS versions (12.x, 15.x, 16.x), the output is consistent, but newer versions may include additional details like 'PortFast' status or 'BPDU guard' configuration.

Always ensure the switch is running the same STP mode (PVST+, Rapid PVST+, or MST) to interpret output correctly.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions