When I first started learning about Spanning Tree Protocol (STP), I thought, “Why does my switch block a link even when there’s no loop?” The answer: Root Bridge Election. Most learners get tripped up trying to remember how STP elects the root bridge and why it’s critical. So today, let me simplify it with real Cisco examples, visual labs in EVE-NG, and practical CLI tips. After this, you’ll not only understand what happens during election—but why it happens that way.
Table of Contents
Theory in Brief – What is STP Root Bridge Election?
The Spanning Tree Protocol (STP) is used to prevent Layer 2 loops in Ethernet networks. At the heart of STP is the Root Bridge—a central switch that all other switches use as a reference point.
STP elects the Root Bridge based on the Bridge ID (BID), which is a combination of:
- Bridge Priority (default: 32768)
- MAC Address (used as tie-breaker)
The switch with the lowest BID becomes the Root Bridge.
In default conditions (all priorities equal), the switch with the lowest MAC address wins. That’s why older switches (with lower MACs) often become Root Bridge by accident!
Once elected, STP recalculates the network topology to prevent loops by placing non-essential links into a blocking state.
Summary – STP Root Bridge Basics
Feature | Description |
---|---|
Root Bridge | Central switch elected to avoid loops |
Bridge ID (BID) | Bridge Priority + MAC Address |
Default Priority | 32768 |
Election Criteria | Lowest BID wins |
Tie Breaker | Lower MAC address wins |
CLI to Set Root Priority | spanning-tree vlan X priority <value> |
Default Election Risk | Older switch (with low MAC) may become root |
Manual Control Recommended? | Yes – always set root manually for predictability |
Pros and Cons of Default vs Manual Root Bridge Election
Criteria | Default Election | Manual Election |
---|---|---|
Root Bridge Control | Unpredictable (MAC dependent) | Fully predictable |
Network Stability | Can lead to inefficient paths | Optimized path selection |
Configuration Effort | Minimal | Requires manual CLI setup |
Troubleshooting Ease | Lower | Higher due to known root location |
Best Practice | Not recommended | Always recommended |
Essential CLI Commands (Cisco IOS)
Task | CLI Command | Description |
---|---|---|
View root bridge for VLAN | show spanning-tree vlan X | See root bridge, priority, MAC |
Set switch as root bridge (low priority) | spanning-tree vlan 10 priority 4096 | Lower = higher election chance |
Set secondary root bridge | spanning-tree vlan 10 priority 8192 | Secondary option if primary fails |
Show all VLAN spanning-tree states | show spanning-tree summary | Overview of STP state |
Display interface STP role and state | show spanning-tree interface <intf> | Check root/designated/blocking roles |
Debug election traffic (advanced) | debug spanning-tree events | View STP BPDUs and root updates |
Real-World Use Cases
Scenario | Why Root Election Matters |
---|---|
Campus Network with Access & Core Layers | Root Bridge should be Core switch to optimize paths |
Old Access Switch becomes root | Can cause suboptimal traffic paths |
Redundant Topology with High Uptime | Manual election avoids topology instability |
Rapid PVST+ in VLAN-heavy network | Setting root per VLAN helps STP stability |
EVE-NG LAB – STP Root Election Simulation
Lab Goal:
- Show how STP elects the root bridge by default.
- Then manually configure a switch to be the Root Bridge.
Topology:

All switches are in VLAN 10. SW1 has the lowest MAC address.
Default Config – Let Election Happen
! On all switches: spanning-tree vlan 10
Run:
show spanning-tree vlan 10
You’ll see SW1 elected as root bridge due to its lowest MAC.
Force SW2 as Root Bridge
SW2(config)# spanning-tree vlan 10 priority 4096
Verify again:
show spanning-tree vlan 10
Now SW2 becomes Root Bridge due to lower priority.
Verification Output
Root ID Priority 4096 Address 00d0.c123.abcd This bridge is the root
STP recalculates port roles—some interfaces move from forwarding to blocking.
Troubleshooting Tips
Symptom | Likely Cause | Command / Fix |
---|---|---|
Wrong switch is Root Bridge | Default priority too high | Lower priority with CLI |
Loops observed during boot | No Root Bridge stability | Set root bridge manually |
Interfaces stuck in blocking | Wrong STP port roles | Verify with show spanning-tree |
No STP seen on interfaces | STP disabled or BPDU filtered | Use debug spanning-tree events |
Unstable topology with frequent TCNs | Root flapping or election issues | Lock root with static priority |
FAQs – STP Root Bridge Election
1. What is the STP Root Bridge and why is it important?
Answer:
The Root Bridge is the central reference point in an STP topology. All switches calculate the shortest path to this root bridge to determine their port roles (Root Port, Designated Port, etc.). A stable and strategically located Root Bridge helps ensure efficient traffic forwarding and loop-free paths across the Layer 2 network.
2. How is the Root Bridge elected in STP?
Answer:
The STP Root Bridge is elected based on the Bridge ID, which is made up of:
- Bridge Priority (default: 32768)
- MAC address
The switch with the lowest Bridge ID becomes the root. If all switches have the same priority, the switch with the lowest MAC address wins.
3. What is the Bridge ID and how is it formed?
Answer:
The Bridge ID is a 64-bit value that includes:
- 16-bit Priority (default: 32768)
- 48-bit MAC Address of the switch
Example:
Bridge ID = 32768.0001.1234.5678
You can view it using:
show spanning-tree
4. How can I change which switch becomes the Root Bridge?
Answer:
You can manually lower the priority of the desired switch:
spanning-tree vlan 1 priority 4096
Lower numbers = higher priority. For faster configuration, use:
spanning-tree vlan 1 root primary
This command automatically sets the priority lower than all others in the VLAN.
5. What happens if two switches have the same priority and MAC address?
Answer:
In practice, this is extremely rare, as MAC addresses are unique. But in the event of manually assigned MACs or cloning:
- The switch with the lowest interface ID (like port number) in the lowest BPDU will win.
This situation can create unpredictable elections and should be avoided by ensuring unique MACs.
6. How can I verify which switch is the Root Bridge?
Answer:
On any switch, use:
show spanning-tree
Look for:
This bridge is the root
→ You’re on the root bridgeRoot ID
→ Shows the Bridge ID, MAC, and priority of the root bridge if this isn’t it
7. Can a Root Bridge exist per VLAN?
Answer:
Yes, in PVST+ or Rapid PVST, each VLAN has its own separate STP instance, and therefore its own Root Bridge.
In MST (Multiple Spanning Tree), multiple VLANs can be grouped into instances, and each instance can have a different Root Bridge.
8. What is the default priority for all Cisco switches?
Answer:
The default STP priority for all Cisco switches is:
32768
Because this is the default, without manual configuration, MAC address becomes the deciding factor in elections.
9. What are the implications of not controlling the Root Bridge election?
Answer:
If left to default settings:
- A random switch could become the root based on the lowest MAC
- May lead to suboptimal paths
- Higher risk of instability or long convergence times
Best practice is to manually configure the root and backup root to ensure predictable STP behavior.
10. What CLI command sets a backup root bridge?
Answer:
Use the following to configure a backup root:
spanning-tree vlan 1 root secondary
This sets the priority slightly higher than the root bridge, ensuring it becomes root only if the primary fails. Helps maintain STP stability during switch failures.
YouTube Lab Link
Watch the Complete CCNP Enterprise: STP Root Bridge Election Explained: Priority, MAC & CLI Lab Demo & Explanation on our channel:
Final Note
Understanding how to differentiate and implement STP Root Bridge Election Explained: Priority, MAC & CLI is critical for anyone pursuing CCNP Enterprise (ENCOR) certification or working in enterprise network roles. Use this guide in your practice labs, real-world projects, and interviews to show a solid grasp of architectural planning and CLI-level configuration skills.
If you found this article helpful and want to take your skills to the next level, I invite you to join my Instructor-Led Weekend Batch for:
CCNP Enterprise to CCIE Enterprise – Covering ENCOR, ENARSI, SD-WAN, and more!
Get hands-on labs, real-world projects, and industry-grade training that strengthens your Routing & Switching foundations while preparing you for advanced certifications and job roles.
Email: info@networkjourney.com
WhatsApp / Call: +91 97395 21088
Upskill now and future-proof your networking career!