Content

| 3.6 |  | STP Configuration |
| 3.6.3 |  | Modifying the root bridge |

By default, switches with Cisco PVST and PVST+ maintain a separate spanning-tree instance for each active VLAN configured on it. A bridge ID, consisting of the switch priority and the switch MAC address, is associated with each instance. For each VLAN, the switch with the lowest bridge ID becomes the root switch for that VLAN.

To configure a switch to become the root for the specified VLAN, use the spanning-tree vlan vlan-id root primary global configuration command to modify the switch priority from the default value (32768) to a significantly lower value. When this command is entered, the switch checks the switch priority of the root switches for each VLAN. Because of the extended system ID support, the switch sets its own priority for the specified VLAN to 24576 if this value will cause this switch to become the root for the specified VLAN.

If any root switch for the specified VLAN has a switch priority lower than 24576, the switch sets its own priority for the specified VLAN to 4096 less than the lowest switch priority. 4096 is the value of the least-significant bit of a 4-bit switch priority value.

Beginning in privileged EXEC mode, follow these steps to configure a switch to become the root for the specified VLAN.

> Note: The spanning-tree vlan vlan-id root primary global configuration command fails if the value necessary to be the root switch is less than 1.

Before Release 12.1(9)EA1, entering the spanning-tree vlan vlan-id root primary global configuration command on a Catalyst 2950 switch (no extended system ID) caused it to set its own switch priority for the specified VLAN to 8192 if this value caused this switch to become the root for the specified VLAN.

If any root switch for the specified VLAN has a switch priority lower than 8192, the switch sets its own priority for the specified VLAN to 1 less than the lowest switch priority.

These examples show the effect of the spanning-tree vlan vlan-id root primary command with and without the extended system ID support:

1. For Catalyst 2950 switches with the extended system ID (Release 12.1(9)EA1 and later), if all network devices in VLAN 20 have the default priority of 32768, entering the spanning-tree vlan 20 root primary command on the switch sets the switch priority to 24576, which causes this switch to become the root switch for VLAN 20.
2. For Catalyst 2950 switches without the extended system ID (software earlier than Release12.1(9)EA1), if all network devices in VLAN 100 have the default priority of 32768, entering the spanning-tree vlan 100 root primary command on the switch sets the switch priority for VLAN 100 to 8192, which causes this switch to become the root switch for VLAN 100.

If the network consists of switches that both do and do not support the extended system ID, it is unlikely that the switch with the extended system ID support will become the root switch. The extended system ID increases the switch priority value every time the VLAN number is greater than the priority of the connected switches running older software.

The root switch for each spanning-tree instance should be a backbone or distribution switch. Do not configure an access switch as the spanning-tree primary root.

Use the diameter keyword to specify the Layer 2 network diameter (that is, the maximum number of switch hops between any two end stations in the Layer 2 network). When the network diameter is specified, the switch automatically sets an optimal hello time, forward-delay time, and maximum-age time for a network of that diameter, which can significantly reduce the convergence time. The hello keyword can be used to override the automatically calculated hello time.

After configuring the switch as the root switch, avoiding manual configuration of the hello time, forward-delay time, and maximum-age time using the spanning-tree vlan vlan-id hello-time, spanning-tree vlan vlan-id forward-time, and the spanning-tree vlan vlan-id max-age global configuration commands is recommended.

To return the switch to its default setting, use the no spanning-tree vlan vlan-id root global configuration command.