5.2 STP Processes
5.2.9 Enabling and verifying Spanning Tree
By default, STP is enabled for every port on the switch. If for some reason STP has been disabled, you can reenable it on a set command-based switch with the set spantree enable command.

You can also selectively enable or disable specific ports on the switch.

Switch> (enable) set spantree enable mod-num/port-num
Switch> (enable) set spantree disable mod-num/port-num

The following example shows how to enable STP and verify that it is enabled on a selected virtual LAN (VLAN).

Switch> (enable) set spantree enable all
Spantree enabled.

To enable STP on a Cisco IOS command-based system, enter the following command in global configuration mode.

Switch(config)#spantree vlan-list

Where vlan-list is the number of the specific VLAN on which you are enabling STP. You can include up to ten VLANs in the list.

To disable STP on a VLAN, enter the no spantree vlan-list command in global configuration mode.

The most important switch command for working with STP is the show spantree command. Although this command offers several useful parameters, this section explains only the basic syntax. Figure illustrates a sample of the show spantree output from a set command-based switch (Cat-B) in the sample network.

This show spantree output in Figure can be broken down into four sections as follows:

  • Global statistics for the current switch/bridge (lines 2-4)
  • Root-bridge statistics (lines 5-9)
  • Local-bridge statistics (lines 10-12)
  • Port statistics (lines 13-16)

The global statistics appear at the top of the screen. The first line of this section (VLAN 1) indicates that the output contains information only for VLAN 1. The second line indicates that STP is enabled on this Catalyst® Switch for this VLAN. The final line of this section shows that the IEEE version of STP is being utilized (this cannot be changed on most Catalyst Switches).

The first two lines of the root-bridge statistics display the BID of the current root bridge. The BID subfields are displayed separately - Designated Root shows the MAC address contained in the low-order six bytes, whereas Designated Root Priority holds the high-order two bytes. The cumulative root path cost to the root bridge is displayed in the Designated Root Cost field. The fourth line of this section (Designated Root Port) shows the current root port of the local device. The last line of the root-bridge statistics section shows the timer values currently set on the root bridge. These values are used throughout the entire network (at least for VLAN 1) to provide consistency. The term designated is used here to signify that these values pertain to the bridge that this device currently believes is the root bridge. However, because of topology changes and propagation delays during network convergence, this information might not reflect the characteristics of the true root bridge.

The local bridge statistics section displays the BID of the current bridge in the first two lines. The locally configured timer values are shown in the third line of this section.

Note: The timer values shown in the local-bridge statistics section are not utilized unless the current bridge becomes the root bridge at some point.

The port statistics section is displayed at the bottom of the screen. Depending on the number of ports present in the Catalyst Switch, this display can continue for many screens using the more prompt. This information displays the path-cost value associated with each port. This value is the cost that is added to the Root Path Cost field contained in BPDUs received on this port. In other words, Cat-B receives BPDUs on Port 1/1 with a cost of 0 because they are sent by the root bridge. The Port 1/1 cost of 19 is added to this zero-cost value to yield a designated root cost of 19. In the outbound direction, Cat-B sends BPDUs downstream with a cost of 19-the port 1/2 path cost of 19 is not added to transmitted BPDUs (see 5.2.3).

Figure illustrates the show spanning-tree command output from a Cisco IOS command-based switch. As can be seen, this output is formatted differently but contains the same information.
Interactive Lab Activity  (Flash, 301 kB)
  In this activity, you will learn how to configure a root bridge and port priorities on a Catalyst 2900 series switch.