DebugPrivileged EXEC

debug spanning-tree events

Enables debugging of Spanning Tree Protocol (STP) state transitions and topology change events to troubleshoot STP convergence issues.

Syntax·Privileged EXEC
debug spanning-tree events

When to Use This Command

  • Investigating why a switch is unexpectedly blocking or forwarding ports in a redundant topology.
  • Troubleshooting frequent topology changes causing network instability or MAC address flapping.
  • Verifying that STP converges correctly after adding or removing links in a switched network.
  • Diagnosing why a specific port is not transitioning from blocking to forwarding state.

Command Examples

Basic debug spanning-tree events output

debug spanning-tree events
STP: VLAN0001 new root addr 0011.2233.4455, priority 32769
STP: VLAN0001 Topology Change rcvd on Gi0/1
STP: VLAN0001 Gi0/1 -> blocking
STP: VLAN0001 Gi0/2 -> listening
STP: VLAN0001 Gi0/2 -> learning
STP: VLAN0001 Gi0/2 -> forwarding
STP: VLAN0001 Gi0/1 -> listening
STP: VLAN0001 Gi0/1 -> learning
STP: VLAN0001 Gi0/1 -> forwarding

Each line shows an STP event: root bridge change, topology change received, or port state transitions. 'new root addr' indicates a new root bridge election. 'Topology Change rcvd' means a TCN was received. Port states progress from blocking to listening to learning to forwarding.

Debug spanning-tree events with topology change details

debug spanning-tree events
STP: VLAN0001 Topology Change rcvd on Gi0/1
STP: VLAN0001 Topology Change rcvd on Gi0/2
STP: VLAN0001 Topology Change rcvd on Gi0/3
STP: VLAN0001 Topology Change rcvd on Gi0/4
STP: VLAN0001 Topology Change rcvd on Gi0/5
STP: VLAN0001 Topology Change rcvd on Gi0/6
STP: VLAN0001 Topology Change rcvd on Gi0/7
STP: VLAN0001 Topology Change rcvd on Gi0/8

Multiple topology change notifications on many ports indicate a flapping link or a device repeatedly sending TCNs, which can cause MAC address table flushes and network instability.

Understanding the Output

The debug output displays STP events in real time. Each line starts with 'STP:' followed by the VLAN ID. Key events include 'new root addr' (a new root bridge has been elected), 'Topology Change rcvd' (a topology change notification was received on a port), and port state transitions (blocking, listening, learning, forwarding). A healthy network should show occasional topology changes only when links are added or removed. Frequent or repeated topology changes indicate a problem such as a flapping link, a misconfigured port, or a device generating excessive TCNs. Watch for rapid state transitions or many TCNs on multiple ports, which can degrade network performance.

CCNA Exam Tips

1.

CCNA exam tip: Remember that 'debug spanning-tree events' is a privileged EXEC command and can impact CPU; always use 'undebug all' to disable.

2.

CCNA exam tip: The exam may ask you to interpret debug output to identify a flapping port or excessive topology changes.

3.

CCNA exam tip: Know that STP port states progress in order: blocking, listening, learning, forwarding (or disabled).

4.

CCNA exam tip: Understand that a topology change causes switches to shorten MAC address aging timers to 15 seconds (default) to flush stale entries.

Common Mistakes

Mistake 1: Leaving debug enabled on a production switch, causing high CPU usage and potential packet loss.

Mistake 2: Confusing 'debug spanning-tree events' with 'debug spanning-tree all', which generates much more output and is even more CPU-intensive.

Mistake 3: Not using 'terminal monitor' before debugging over a remote session, so debug messages are not displayed.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions