How to Configure Spanning-Tree Bridge ID – Briefly Explained

When configuring a specific switch as a Root Bridge, the bridge ID priority value must be adjusted to be lower than the bridge priority values of all the other switches on the network. There are two different methods for configuring the bridge priority value on a Cisco Catalyst switch.

Method 1

To ensure the switch has the lowest bridge priority value, use the spanning-tree vlan vlan-id root primary command in global configuration mode. The command set the priority for the switch to the predefined value of 24,576 or the highest multiple of 4,096, less than the lowest bridge priority detected on the network.

We can also configure the alternate root bridge to use the “spanning-tree vlan vlan-id root secondary” command in global configuration mode. The predefined bridge priority value for the secondary root bridge is 28,673.

This value ensures that the alternate switch becomes the root bridge if the primary root bridge fails. This configuration assumes that the rest of the network switches have the default 32,768 priority value defined.

Bridge ID configuration

Now, look at the figure above. Switch-1 is elected as the Root Bridge in the spanning tree process. The bridge ID priority is the same in all switches, which is 32769. The switch-1 MAC address is the lowest among all switches.

So, the spanning tree was elected switch-1 as a Root Bridge based on the lowest MAC address. However, we want to configure switch-3 as the root bridge and switch-2 as the secondary root bridge. The configuration of switch-3 for the root bridge is as follows:-

Switch-3>enable

Switch-3#config terminal

Switch-3(config)#spanning-tree vlan 1 root primary

Switch-3(config)# do wr

Now, we will configure switch-2 as the secondary root bridge. If the primary root bridge becomes faulty, the switch will act as the root bridge immediately, and the network should not need to elect the root bridge. The configuration of switch-2 is as under:-

Switch-2>enable

Switch-2#config terminal

Switch-2(config)#spanning-tree vlan 1 root secondary

Switch-2(config)# do wr

Now we can verify the configuration all switches. The output of the “show spanning-tree” command on all switches is as under:

Method 2

Another method for root bridge configuration is the configuration bridge priority value. The command configuring the bridge priority value is “spanning-tree vlan vlan-id priority value” in global configuration mode. The priority value is configured in the increase of 4,096, and the range is between 0 and 61,440.

Now I will cancel the previous command in switch-3 and switch2 and want to configure the bridge priority values. The switch-3 configuration is as under:-

Switch-3>enable

Switch-3#config terminal

Switch-3# no spanning-tree vlan 1 root primary

Switch-3(config)#spanning-tree vlan 1 priority 24576

Switch-3(config)# do wr

We can do the same for the secondary root bridge. To verify the bridge priority of a switch, we can use the same “show spanning-tree” command. After configuring the root bridge priority of the switch-3, the output of the show spanning-tree command is the following:-

The switch’s priority has been set to 24,576. Also, notice that the switch is designated as the root bridge for the spanning-tree instance. We can see the Bridge ID priority is set to 24577 because it is 24576 +1 = 24577. The 1 is the value of the VLAN, which is added to the bridge priority to construct the extended system ID.