Spanning-Tree Root Bridge Configuration

Hello David

This is an interesting one because this command operates somewhat differently than more conventional IOS commands. First of all, keep in mind that this command runs a hardwired script in the background that performs specific functions. After doing a bit of research, it seems that this command functions slightly differently depending on the IOS version and platform.

Some documentation for the 15.2(2)E IOS version for example, states that:

Because of the extended system ID support, the switch sets the switch 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.

Other documentation for IOS 12.4 states that:

The spanning-tree root primary command alters this switch’s bridge priority to 8192. If you enter the spanning-tree root primary command and the switch does not become the root switch, then the bridge priority is changed to 100 less than the bridge priority of the current bridge. If the switch still does not become the root, an error results.

Still other documentation states that:

The primary keyword sets the priority to 24,576, and the secondary keyword sets the priority to 28,672.

There may be other slightly different behaviors as well. The point here is that this command will run a script that will examine the current root bridge, and will attempt to change the priority values of the local switch so that it becomes the root bridge. The script will examine the current situation and choose a priority value that makes the local switch the root, just like it did in the experiment that you shared in your post.

The other thing you must keep in mind is that since this command is a script, it will be run at the moment you put in the command, and the resulting priority value will be used. This value will not change unless the script is run again. If the root priorities of other switches on the topology change, and cause another switch to become the root, the script does not rerun to make the local switch root again. In other words, the command is not preemptive.

So the behavior you are seeing is correct, since it caused the local switch to become (or remain) the root bridge.

I hope this has been helpful!

Laz