Tuesday, November 30, 2010

Troubleshooting Spanning Tree

Have you ever suspected spanning tree to be an issue in your network and all you want to know is when the last spanning tree change was?

I have always used this command:
"show spanning-tree active detail"

The highlighted area is all I am really wanting to know, but you get a lot more to sort through. If you have multiple spanning trees for all your VLANs you will have to pick through the output to find this information for each VLAN. Look below the example output for a better command.

*****EXAMPLE OUTPUT*****

VLAN0001 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, sysid 1, address fcfb.fb30.5380
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 32769, address 0012.7f12.0680
  Root port is 513 (GigabitEthernet5/1), cost of root path is 4
  Topology change flag not set, detected flag not set
  Number of topology changes 545 last change occurred 00:28:02 ago
          from TenGigabitEthernet9/2
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 480

 Port 15 (GigabitEthernet1/15) of VLAN0001 is designated forwarding
   Port path cost 4, Port priority 128, Port Identifier 128.15.
   Designated root has priority 32769, address 0012.7f12.0680
   Designated bridge has priority 32769, address fcfb.fb30.5380
   Designated port id is 128.15, designated path cost 4
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 1410218, received 0

 Port 26 (GigabitEthernet1/26) of VLAN0001 is designated forwarding
   Port path cost 4, Port priority 128, Port Identifier 128.26.
   Designated root has priority 32769, address 0012.7f12.0680
   Designated bridge has priority 32769, address fcfb.fb30.5380
   Designated port id is 128.26, designated path cost 4
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 1039830, received 0

--------------------------------------------------------------------------------------

Try this command instead:
"show spanning-tree active detail | inc executing|y changes | from"

See how much more concise this command is. You can quickly see which VLAN has experienced changes and from which port.

*****EXAMPLE OUTPUT*****


VLAN0001 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 544 last change occurred 02:42:39 ago
          from TenGigabitEthernet9/2
 VLAN0010 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 290 last change occurred 02:42:39 ago
          from TenGigabitEthernet9/2
 VLAN0011 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 133 last change occurred 4w3d ago
          from GigabitEthernet1/29
 VLAN0012 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 134 last change occurred 4w3d ago
          from GigabitEthernet2/33
 VLAN0013 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 134 last change occurred 4w3d ago
          from GigabitEthernet2/33
 VLAN0014 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 139 last change occurred 4w3d ago
          from GigabitEthernet2/33
 VLAN0015 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 147 last change occurred 3w0d ago
          from GigabitEthernet2/35
 VLAN0016 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 133 last change occurred 4w3d ago
          from GigabitEthernet2/33
 VLAN0017 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 135 last change occurred 4w3d ago
          from GigabitEthernet2/33