show spanning-tree

To display information about the Spanning Tree Protocol (STP), use the show spanning-tree command.

show spanning-tree [ blockedports | inconsistentports | pathcost method ]

Syntax Description

blockedports
(Optional) Displays the alternate ports blocked by STP.
inconsistentports
(Optional) Displays the ports that are in an inconsistent STP state.
pathcost method
(Optional) Displays whether short or long path cost method is used. The method differs for Rapid Per VLAN Spanning Tree Plus (Rapid PVST+) (configurable, default is short) and Multiple Spanning Tree (MST) (nonconfigurable, operational value is always long).

Command Default

None

Command Modes

EXEC mode

Command History

Release
Modification
4.0(0)N1(1a)
This command was introduced.

Usage Guidelines

The STP port type displays only when you have configured the port as either an STP edge port or an STP network port. If you have not configured the STP port type, no port type displays.

The table below describes the fields that are displayed in the output of show spanning-tree commands.

show spanning-tree Command Output Fields
Field
Definition
Role
Current port STP role. Valid values are as follows:
  • Desg (designated)
  • Root
  • Altn (alternate)
  • Back (backup)
Sts
Current port STP state. Valid values are as follows:
  • BLK (blocking)
  • DIS (disabled)
  • LRN (learning)
  • FWD (forwarding)
Type
Status information. Valid values are as follows:
  • P2p/Shr—The interface is considered as a point-to-point (shared) interface by the spanning tree.
  • Edge—The port is configured as an STP edge port (either globally using the default command or directly on the interface) and no BPDU has been received.
  • Network—The port is configured as an STP network port (either globally using the default command or directly on the interface).
  • *ROOT_Inc, *LOOP_Inc, *PVID_Inc, *BA_Inc, and *TYPE_Inc—The port is in a broken state (BKN*) for an inconsistency. The broken states are Root inconsistent, Loopguard inconsistent, PVID inconsistent, Bridge Assurance inconsistent, or Type inconsistent.

Note Display output differs slightly depending on whether you are running Rapid Per VLAN Spanning Tree Plus (Rapid PVST+) or Multiple Spanning Tree (MST).


Examples

This example shows how to display spanning tree information:

switch# show spanning-tree
 
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 1
Address 000d.ecb0.fdbc
Cost 2
Port 4096 (port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
 
Bridge ID Priority 61441 (priority 61440 sys-id-ext 1)
Address 0005.9b78.6e7c
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
 
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Po1 Root FWD 1 128.4096 (vPC peer-link) Network P2p
Po3 Root FWD 1 128.4098 (vPC) P2p
Po123 Desg FWD 4 128.4218 Edge P2p
Eth1/11 Desg BKN*2 128.139 P2p *TYPE_Inc
Eth1/12 Desg BKN*2 128.140 P2p *TYPE_Inc
Eth1/15 Desg BKN*2 128.143 P2p *TYPE_Inc
Eth1/16 Desg BKN*2 128.144 P2p *TYPE_Inc
Eth1/33 Desg FWD 2 128.161 Edge P2p
<--Output truncated-->
switch#
 

This example shows how to display the blocked ports in spanning tree:

switch# show spanning-tree blockedports
 
Name Blocked Interfaces List
-------------------- ------------------------------------
VLAN0001 Eth1/11, Eth1/12, Eth1/15, Eth1/16
 
 
Number of blocked ports (segments) in the system : 4
 
switch#
 

This example shows how to determine if any ports are in any STP-inconsistent state:

switch# show spanning-tree inconsistentports
 
Name Interface Inconsistency
-------------------- ---------------------- ------------------
VLAN0001 Eth1/11 Port Type Inconsistent
VLAN0001 Eth1/12 Port Type Inconsistent
VLAN0001 Eth1/15 Port Type Inconsistent
VLAN0001 Eth1/16 Port Type Inconsistent
 
 
Number of inconsistent ports (segments) in the system : 4
 
switch#
 

This example shows how to display the path cost method:

switch(config)# show spanning-tree pathcost method Spanning tree default pathcost method used is short
switch#
 

Related Commands

Command
Description
show spanning-tree active
Displays information about STP active interfaces only.
show spanning-tree bridge
Displays the bridge ID, timers, and protocol for the local bridge on the switch.
show spanning-tree brief
Displays a brief summary about STP.
show spanning-tree detail
Displays detailed information about STP.
show spanning-tree interface
Displays the STP interface status and configuration of specified interfaces.
show spanning-tree mst
Displays information about Multiple Spanning Tree (MST) STP.
show spanning-tree root
Displays the status and configuration of the root bridge for the STP instance to which this switch belongs.
show spanning-tree summary
Displays summary information about STP.
show spanning-tree vlan
Displays STP information for specified VLANs.