Hands-On Lab: Configuring Spanning Tree Protocol Root Bridges Manually

This hands-on lab manually influences Spanning Tree root bridge election by adjusting bridge priority on two competing switches, verifying which switch becomes root before and after the change, and confirming the resulting port roles update accordingly.

STP Root Bridge PriorityBridge IDRoot Bridge Election

~3 min read · Updated Sep 22, 2026

Lab Objective

Observe the default Spanning Tree root bridge election outcome between two switches, then manually lower the priority on the preferred switch to force it to become root, and verify the resulting change in port roles.

Lab Purpose

Leaving root bridge election entirely to chance, based only on the lowest MAC address, can result in a poorly positioned or underpowered switch becoming root, creating suboptimal traffic paths. Deliberately setting priority on a well-placed switch is standard practice in production networks.

Lab Topology

Switch1 (core switch, preferred root)
Switch2 (access switch)

Connected via two redundant trunk links,
both in VLAN 1

Task 1: Identify the Current Root Bridge

Use a show command on both switches to determine which one is currently acting as the root bridge by default.

Task 2: Record the Default Bridge Priorities

Note the default priority value shown on each switch.

Task 3: Manually Set Switch1 as Root

Lower Switch1's bridge priority for VLAN 1 so it becomes the root bridge regardless of MAC address.

Task 4: Verify Switch1 Is Now Root

Confirm both switches now agree Switch1 is the root bridge.

Task 5: Verify Port Roles Updated Accordingly

Confirm Switch2's ports show the correct root port and any blocking port relative to the new root.

Solution and Verification

Switch1# show spanning-tree vlan 1 | include Priority

Bridge ID  Priority    32768

Switch2# show spanning-tree vlan 1 | include Priority

Bridge ID  Priority    32768
-- Both switches default to the same priority
-- of 32768 -- the tiebreaker is therefore the
-- lowest MAC address, which may or may not
-- favor the switch actually intended to be root

Switch1# show spanning-tree vlan 1 | include Root

Root ID    Priority    32768
           This bridge is the root
-- (in this scenario, Switch1 happened to already
--  win by MAC address, but this outcome is
--  never guaranteed without explicit configuration)

Switch1(config)# spanning-tree vlan 1 priority 4096

Switch1# show spanning-tree vlan 1 | include Priority

Bridge ID  Priority    4096
           This bridge is the root

Switch2# show spanning-tree vlan 1 | include Root

Root ID    Priority    4096
           Root has priority 4096, address 00aa.bb00.1111
-- Switch2 now explicitly recognizes Switch1
-- (with the lower, deliberately configured
-- priority) as the root, regardless of MAC
-- address comparisons

Switch2# show spanning-tree vlan 1

Interface     Role  Sts  Cost   Prio.Nbr
Gi1/0/1       Root  FWD  4      128.1
Gi1/0/2       Altn  BLK  4      128.2
-- Switch2's port toward the (now confirmed)
-- root bridge is correctly identified as the
-- Root Port, with the redundant link blocking

Key Takeaway

Priority must be a multiple of 4096 (Cisco IOS enforces this), and the lower the value, the higher the preference for becoming root — deliberately configuring priority is essential in any network with more than a trivial number of switches, since relying on MAC address alone provides no control over which switch actually ends up as root.

Written & researched by Dr. Shahin Siami

Related Articles

Hands-On Lab: Setting Switchports to Dynamic Trunking Modes

This hands-on lab configures switchport dynamic desirable and dynamic auto modes, demonstrating how Dynamic Trunking Protocol automatically negotiates whether a link becomes a trunk or remains an access port, and covers why relying on DTP is generally discouraged in production networks.

Continue

Hands-On Lab: Configuring, Verifying, and Troubleshooting EtherChannel (Static/PAgP/LACP)

This hands-on lab bundles two physical links between switches into a single logical EtherChannel using static, PAgP, and LACP modes in turn, verifies each bundle forms correctly, and demonstrates the mismatched-mode failure that prevents a bundle from forming.

Continue

Hands-On Lab: Enabling Rapid Per-VLAN Spanning Tree (RPVST+)

This hands-on lab migrates a switch from classic PVST+ to Rapid PVST+, comparing the significantly faster convergence time and the updated port role terminology that comes with the newer protocol.

Continue

Hands-On Lab: Configuring Spanning Tree Protocol for Access Ports (PortFast)

This hands-on lab configures PortFast on an access port connecting to an end-user device, bypassing the normal listening and learning delay so the port forwards traffic immediately, and covers why PortFast should never be applied to a port connecting to another switch.

Continue

Hands-On Lab: Assigning Spanning Tree Priority to Multiple VLANs Simultaneously

This hands-on lab configures Spanning Tree bridge priority across several VLANs in a single command using a VLAN range, rather than repeating the configuration individually for each VLAN, and verifies the priority was correctly applied to every VLAN in the range.

Continue

Hands-On Lab: Configuring Spanning Tree Root Bridges Using the IOS Macro Command

This hands-on lab uses the spanning-tree root primary and root secondary macro commands to configure a primary and backup root bridge without manually calculating priority values, and verifies IOS automatically selects an appropriate priority relative to the current root.

Continue