Home CCNA How to Configure Spanning-Tree Bridge ID – Briefly Explained
Network diagram showing spanning tree configuration with bridge IDs and VLANs

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 the alternate switch becomes the root bridge if the primary root bridge fails. This configuration assumes that the rest of the network switches have defined the default 32,768 priority value.

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: 32769. The switch-1 MAC address is the lowest among all switches.

So, the spanning tree 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# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch-3(config)# spanning-tree vlan 1 root primary
Switch-3(config)# end
Switch-3# write memory
Building configuration...
[OK]
Switch-3#

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# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch-2(config)# spanning-tree vlan 1 root secondary
Switch-2(config)# end
Switch-2# write memory
Building configuration...
[OK]
Switch-2#

Now we can verify the configuration of 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 setting the 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 switches 3 and 2, and I want to configure the bridge priority values. The switch-3 configuration is as under:

Switch-3> enable
Switch-3# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch-3(config)# no spanning-tree vlan 1 root primary
Switch-3(config)# spanning-tree vlan 1 priority 24576
Switch-3(config)# end
Switch-3# write memory
Building configuration...
[OK]
Switch-3#

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 Switch-3. After configuring the root bridge priority of the switch-3, the output of the show spanning-tree command is the following: –

Switch-3# show spanning-tree

VLAN001
  Spanning tree enabled protocol ieee
  Root ID
    Priority    24577
    Address     000D.D368.1B64
    This bridge is the root
    Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID
    Priority    24577    (priority 24576 sys-id-ext 1)
    Address     000D.D368.1B64
    Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- ----
Fa0/1            Desg FWD 19        128.1    P2p
Fa0/2            Desg FWD 19        128.2    P2p
Switch-3#

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

FAQs

What is the default bridge priority in STP, and how does it influence the root bridge election?

The default priority is 32,768 for all Cisco switches in STP. The switch with the lowest MAC address wins the root election when the priorities are the same. For VLANs with an extended system ID, it becomes 32,769 (32,768 + VLAN 1). To change the priority, decrease it in steps of 4,096 using commands like ‘spanning-tree vlan 1 priority 24576’ to control where the root bridge is placed, which helps reduce delays when the network is

How does the command “spanning-tree vlan root primary” work to set up the root bridge?

This Cisco command automatically sets the bridge priority to 24,576 (or the highest multiple of 4,096 below the lowest detected priority) for the specified VLAN, making the switch the primary root bridge. It adds the VLAN ID for the extended system ID (e.g., 24,577 for VLAN 1). Run in global config mode, then verify with ‘show spanning-tree’ to confirm “This bridge is the root” and the updated Bridge ID, ideal for proactive STP optimization without manual calculations.

What role does the MAC address play in the STP bridge ID when priorities are equal?

In STP, if all switches have the same priority (default 32,768), the root bridge is elected based on the lowest MAC address as the tiebreaker in the Bridge ID (priority + MAC). For example, Switch-1 with MAC 000A.8B4E.0001 beats others. Extended system ID appends the VLAN number first, but MAC decides ties. Configure priorities to avoid reliance on unpredictable MACs, ensuring consistent topology in enterprise networks with ‘spanning-tree vlan root primary.’

How do you configure a secondary root bridge in Spanning Tree Protocol?

Use ‘spanning-tree vlan vlan-id root secondary’ to set priority to 28,673, positioning the switch as backup root if the primary fails (assuming others default to 32,768). This Cisco feature ensures quick failover without loops. Enter enable mode, configure the terminal, apply the command, and then ‘write memory.’ Verify via ‘show spanning-tree,’ showing higher priority than primaries but lower than defaults, maintaining redundancy in VLAN-specific STP instances for resilient switched environments.

About This Content

Author Expertise: 15 years of experience in NetworkUstad's lead networking architect with CCIE certification. Specializes in CCNA exam preparation and enterprise network…. Certified in: BSC, CCNA, CCNP

🏆 Your Progress

Level 1
🔥 0 day streak
📚
0 Articles
0 Points
🔥
0 Current
🏅
0 Best Streak
Level Progress 0 pts to next level
🎖️ Achievements
🥉 Starter
🥈 Reader
🥇 Scholar
💎 Expert

More from CCNA

Articles tailored to your interests in CCNA

Forum