5.4 STP in the Campus Network
5.4.1 Establishing a root bridge
A Layer 2 switched environment requires STP to prevent loops in the network. In this section we look at modifications that can be made to Spanning Tree in order to compensate for some of its known issues. Scaling STP involves the following tasks:
  • Providing for an optimal topology through the proper placement of the root bridge
  • Providing for efficient workstation access through the use of the PortFast command
  • Load balancing on redundant links through the use of technologies such as PortVlanPri and Fast EtherChannel® technology
  • Improving the convergence time of Spanning Tree during a network reconfiguration through the use of UplinkFast and BackboneFast

One of the most important decisions that must be made in the Spanning-Tree network is the location(s) of the root bridge(s). Proper placement of the root bridge optimizes the path that is chosen by STP. Proper placement of the root bridge will also provide deterministic paths for data. A bridge can be manually configured to be the root bridge, as well as a backup or secondary root bridge. The job of the secondary root bridge is to take over if the primary root bridge fails.

The switch software can be used to configure STP operational parameters in a network. On a set command-based switch, use the set spantree root command to set the primary root for specific VLANs or for all VLANs of the switch. The set spantree secondary command allows you to configure a backup root bridge.

To configure the STP root switch on a set-command based switch, enter the following command in privileged mode.

Switch> (enable) set spantree root vlans [dia network_diameter] [hello hello_time]

This command is explained in Figure . The example in Figure shows how to specify the primary root switch for VLANs 1-10.

As you can see in Figure , the set spantree root command reduces the bridge priority (the value associated with the switch) from the default (32,768 or 0x8000) to a significantly lower value of 8192 or 0x2000, allowing the switch to become the root bridge. Also notice that modifying the diameter changes the Spanning-Tree timers that are advertised to the rest of the switches.

The switch software also provides commands that will allow you to view the status of STP.

To configure the STP root switch on a Cisco IOS command-based switch, enter the following command in global configuration mode:

Switch(config)#spanning-tree [vlan stp-list] priority bridge-priority

As you can see, you must specify the VLAN instance and specify the priority with a value between 0 and 65535. An example of this command is shown in Figure .

As you can see by the first show spanning-tree command in Figure , the default priority is 32768. After entering the spanning-tree command for VLANS 1-10 setting the priority to 16000, you can see the change in the next show spanning-tree command.

Use the show spantree command in privileged mode on a set command-based switch to verify the operation and state of each port and VLAN.