Spanning TreePrivileged EXEC

show spanning-tree vlan [vlan-id]

Displays Spanning Tree Protocol (STP) information for a specific VLAN, including root bridge, port roles, and port states, used to verify STP topology and troubleshoot loops.

Syntax·Privileged EXEC
show spanning-tree vlan [vlan-id]

When to Use This Command

  • Verify which switch is the root bridge for a VLAN after a network change.
  • Check if a specific port is in blocking or forwarding state to troubleshoot connectivity issues.
  • Identify alternate or backup ports for redundancy planning.
  • Confirm STP convergence after adding or removing VLANs.

Command Examples

Show spanning tree for VLAN 10

show spanning-tree vlan 10
VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    24586
             Address     0011.2233.4455
             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     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/1               Desg FWD 4         128.1    P2p
Gi0/2               Root FWD 4         128.2    P2p
Gi0/3               Altn BLK 4         128.3    P2p

VLAN0010: VLAN identifier. Spanning tree enabled protocol ieee: STP mode is 802.1D. Root ID: priority 24586 (24576 base + 10 sys-id-ext), MAC 0011.2233.4455, 'This bridge is the root' indicates this switch is root. Bridge ID: local bridge priority (same as root). Interface: port name. Role: Desg (Designated), Root, Altn (Alternate). Sts: FWD (Forwarding), BLK (Blocking). Cost: path cost to root. Prio.Nbr: port priority and number. Type: P2p (point-to-point link).

Show spanning tree for VLAN 20 on a non-root switch

show spanning-tree vlan 20
VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    24596
             Address     0011.2233.4466
             Cost        4
             Port        2 (GigabitEthernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

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

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

Root ID shows priority 24596 (24576+20), MAC 0011.2233.4466, cost 4 to root via port Gi0/2. Bridge ID priority 32778 (32768+10) indicates this is not root. Port roles: Gi0/1 is Designated (forwarding), Gi0/2 is Root (forwarding), Gi0/3 is Alternate (blocking).

Understanding the Output

The output first shows the VLAN number and STP protocol (ieee for 802.1D, pvst for PVST+, rapid-pvst for RSTP). The Root ID section displays the root bridge's priority (including VLAN sys-id-ext), MAC address, and if this switch is the root. For non-root switches, it shows cost and port to reach root. The Bridge ID section shows the local switch's priority and MAC. The interface table lists each port with Role (Root, Designated, Alternate, Backup), Status (FWD, BLK, LRN, LIS), Cost (path cost to root), and Type (P2p, Shr). In a healthy network, all ports should be either FWD or BLK; LRN is transient. A root port should be FWD, designated ports FWD, alternate/backup ports BLK. Unexpected BLK on a root or designated port indicates a problem. High cost values may cause suboptimal path selection.

CCNA Exam Tips

1.

Remember that the root bridge is identified by lowest bridge ID (priority + MAC). The priority is a multiple of 4096 (or 0-61440 in increments of 4096) plus VLAN ID for PVST+.

2.

On CCNA exam, you may be asked to determine which port is root port based on lowest path cost to root bridge.

3.

Be able to identify STP port states: Blocking (20 sec), Listening (15 sec), Learning (15 sec), Forwarding. Only forwarding ports send/receive data.

4.

Know that 'show spanning-tree vlan' is used to verify STP convergence; if a port stays in blocking unexpectedly, check for configuration errors or loops.

Common Mistakes

Assuming the switch with the lowest MAC is always root; priority is compared first.

Forgetting that VLAN 1 is default and STP runs per VLAN; changes in one VLAN don't affect others.

Misinterpreting 'Altn' as 'Alternate' (RSTP) vs 'Backup' (classic STP); alternate provides alternate path to root, backup provides backup to designated port.

Related Commands

Practice for the CCNA 200-301

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

Practice CCNA Questions