Spanning Tree Show Commands

After configuring Spanning Tree Protocol, which is usually configured on Layer 2 Switches, it may be necessary to verify the settings made. When configuring Cisco Switches, we usually use the CLI command prompt.

Spanning Tree Show Commands

STP Show Commands

After configuring STP, we can learn which Switch is Root Bridge or which Switch Blocked Port has with CLI commands. In addition, we can examine STP PortFast, STP UplinkFast and STP BackboneFast features with these commands.

Create a redundancy network using the GNS3 or Cisco Packet Tracer program and apply the following commands on Switch Privileged Mode to examine what operations the ST is doing.

   Spanning-Tree ? Command

This command shows the show commands of the ST protocol supported on the Switch. You can check the outputs of it by selecting the feature you want to use from the commands listed with the command.

Switch#show spanning-tree ?
  WORD               bridge group list, example 1,3-5,7,9
  active             Report on active interfaces only
  backbonefast       Show spanning tree backbonefast status
  blockedports       Show blocked ports
  bridge             Status and configuration of this bridge
  detail             Detailed information
  inconsistentports  Show inconsistent ports
  interface          Spanning Tree interface status and configuration
  mst                Multiple spanning trees
  pathcost           Show Spanning pathcost options
  root               Status and configuration of the root bridge
  summary            Summary of port states
  uplinkfast         Show spanning tree uplinkfast status
  vlan               VLAN Switch Spanning Trees
  |                  Output modifiers
  

Switch#show spanning-tree 

   Spanning-Tree Command

With this command, you can view general information about the ST protocol on the Switch. You can view the Root ID, Root Bridge, and Interface ports of the Switch and view the port states of the Switch‘s interfaces.

Also, if Root Bridge is configured manually, you can examine the Switch’s Priority value using this command.

Switch#show spanning-tree 

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0012.6620.0800
             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     0012.6620.0800
             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    Shr 
Gi0/1               Desg FWD 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 


Switch#

 

   Spanning-Tree Summary Command

With this command, you can view the connection status of VLANs created on Cisco Switch. You can also view the enabled features of the Standard STP (PVST) protocol with this command. If you have performed the BackboneFast configuration, you can view the information about the BackboneFast feature with this command.

It displays the connection status for VLANs created on the Cisco Switch. You can also view the activated properties of the PVST with this command. If you have performed the BackboneFast configuration steps, you can view the BackboneFast feature information with this command.

Switch#show spanning-tree summary 
Switch is in pvst mode
Root bridge for: VLAN0001
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
EtherChannel misconfig guard is enabled
Configured Pathcost method used is short
UplinkFast                   is disabled
BackboneFast                 is disabled

Name                   Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
VLAN0001                     0         0        0          4          4
---------------------- -------- --------- -------- ---------- ----------
1 vlan                       0         0        0          4          4
Switch#

 

   Spanning-Tree Root Command

You can view Root Bridge information with this command. For example, when you apply this command on a Switch that is not Root Bridge, you can see the Root Bridge ID and Address (0012.66b3.c800).

Switch#show spanning-tree root 

                                        Root    Hello Max Fwd
Vlan                   Root ID          Cost    Time  Age Dly  Root Port
---------------- -------------------- --------- ----- --- ---  ------------
VLAN0001         32769 0012.6620.0800         0    2   20  15                  
Switch#

 

   Spanning-Tree Detail Command

With this command, you can see detailed information on all ports of the Switch. You can view the Priority and Root Bridge information of the Cisco Switch interfaces, Hello Time, Max Age Timer and Forward Delay times as well as the number of BPDU packets sent and received.

Switch#show spanning-tree detail 

 VLAN0001 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, sysid 1, address 0012.6620.0800
  Configured hello time 2, max age 20, forward delay 15
  We are the root of the spanning tree
  Topology change flag not set, detected flag not set
  Number of topology changes 1 last change occurred 00:25:15 ago
          from GigabitEthernet0/0
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15 
  Timers: hello 1, topology change 0, notification 0, aging 300

 Port 1 (GigabitEthernet0/0) of VLAN0001 is designated forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.1.
   Designated root has priority 32769, address 0012.6620.0800
   Designated bridge has priority 32769, address 0012.6620.0800
   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
   Link type is shared by default
   BPDU: sent 773, received 3

 Port 2 (GigabitEthernet0/1) of VLAN0001 is designated forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.2.
   Designated root has priority 32769, address 0012.6620.0800
   Designated bridge has priority 32769, address 0012.6620.0800
   Designated port id is 128.2, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is shared by default
   BPDU: sent 771, received 0

 Port 3 (GigabitEthernet0/2) of VLAN0001 is designated forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.3.
   Designated root has priority 32769, address 0012.6620.0800
   Designated bridge has priority 32769, address 0012.6620.0800
   Designated port id is 128.3, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is shared by default
   BPDU: sent 771, received 0

 Port 4 (GigabitEthernet0/3) of VLAN0001 is designated forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.4.
   Designated root has priority 32769, address 0012.6620.0800
   Designated bridge has priority 32769, address 0012.6620.0800
   Designated port id is 128.4, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is shared by default
   BPDU: sent 773, received 3

Switch#

   Spanning-Tree Interface Command

It is used to examine the interfaces on the device with this command.

The interfaces you want to select are displayed in the following command output. After selecting the interface you want to view, you can see the interface states as below output.

Switch#show spanning-tree interface ?
  GigabitEthernet  GigabitEthernet IEEE 802.3z
  Multilink        Multilink-group interface
  Port-channel     Ethernet Channel of interfaces
  Vlan             Catalyst Vlans

Switch#show spanning-tree interface gigabitethernet 0/0

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001            Desg FWD 4         128.1    Shr 
Switch#show spanning-tree interface gigabitethernet 0/1

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001            Desg FWD 4         128.2    Shr 
Switch#

 

   Spanning-Tree Blocked Command

With this command, you can see the interfaces that are put into Blocked Mode by Spanning Tree Protocol. In short, it shows the ports blocked by STP.

Switch#show spanning-tree blockedports 

Name                 Blocked Interfaces List
-------------------- ------------------------------------

Number of blocked ports (segments) in the system : 0

Switch#

   Spanning-Tree Active Command

This command shows only the interfaces that are active on the Cisco Switch. For example, if the idle-free interfaces are closed by the system administrator, you will be able to view only the active interfaces with this command.

Switch#show spanning-tree active 

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0012.6620.0800
             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     0012.6620.0800
             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    Shr 
Gi0/1               Desg FWD 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 


Switch#

 

   Spanning-Tree Bridge Command

This command shows the Bridge ID information of Cisco Switch.

Switch#show spanning-tree bridge 

                                                   Hello  Max  Fwd
Vlan                         Bridge ID              Time  Age  Dly  Protocol
---------------- --------------------------------- -----  ---  ---  --------
VLAN0001         32769 (32768,   1) 0012.6620.0800    2    20   15  ieee        
Switch#

 

   Spanning-Tree Inconsistentports Command

This command displays ports that are not properly configured in the configuration. For example, if one port Trunk between two interconnected Switches is configured as an Access port, the STP protocol will name this port inconsistently.

Switch#show spanning-tree inconsistentports 

Name                 Interface                Inconsistency
-------------------- ------------------------ ------------------

Number of inconsistent ports (segments) in the system : 0

Switch#

 

   Spanning-Tree BackboneFast Command

This command shows whether the BackboneFast feature is enabled on the Switch.

Switch#show spanning-tree backbonefast 
BackboneFast is disabled
Switch#

 

   Spanning-Tree UplinkFast Command

This command shows whether the UplinkFast feature is enabled on the Switch.

Switch#show spanning-tree uplinkfast
UplinkFast is disabled
Switch#

 

   Spanning-Tree Vlan Command

Finally, you can view STP details such as Root ID, Root Bridge, Priority according to the VLAN number selected with this command.

Switch#sh spanning-tree vlan 1

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0012.6620.0800
             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     0012.6620.0800
             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    Shr 
Gi0/1               Desg FWD 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 

Switch#

   Final Word


For troubleshooting in Cisco Switch or Routers, we need to know and understand show commands in detail. In this article, we have examined the basic commands of the ST protocol. Thanks for following us!

   Related Articles


 What is Default Route
♦ What is Dynamic Routing Protocol
♦ What are The Methods of Switching
 What is Port Security
♦ What is Default Route

2 Comments

  1. Avatar for Bruno Mars Bruno Mars 25 July 2019

    Thank you. That really helped!!

    Reply

Add a Comment

Your email address will not be published. Required fields are marked *

You cannot copy content of this page