STP Root Bridge Election Explained: Priority, MAC & CLI Examples [2025] [CCNP ENTERPRISE]

STP Root Bridge Election Explained: Priority, MAC & CLI Examples [2025]. [CCNP ENTERPRISE]

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.


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

FeatureDescription
Root BridgeCentral switch elected to avoid loops
Bridge ID (BID)Bridge Priority + MAC Address
Default Priority32768
Election CriteriaLowest BID wins
Tie BreakerLower MAC address wins
CLI to Set Root Priorityspanning-tree vlan X priority <value>
Default Election RiskOlder 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

CriteriaDefault ElectionManual Election
Root Bridge ControlUnpredictable (MAC dependent)Fully predictable
Network StabilityCan lead to inefficient pathsOptimized path selection
Configuration EffortMinimalRequires manual CLI setup
Troubleshooting EaseLowerHigher due to known root location
Best PracticeNot recommended Always recommended

Essential CLI Commands (Cisco IOS)

TaskCLI CommandDescription
View root bridge for VLANshow spanning-tree vlan XSee root bridge, priority, MAC
Set switch as root bridge (low priority)spanning-tree vlan 10 priority 4096Lower = higher election chance
Set secondary root bridgespanning-tree vlan 10 priority 8192Secondary option if primary fails
Show all VLAN spanning-tree statesshow spanning-tree summaryOverview of STP state
Display interface STP role and stateshow spanning-tree interface <intf>Check root/designated/blocking roles
Debug election traffic (advanced)debug spanning-tree eventsView STP BPDUs and root updates

Real-World Use Cases

ScenarioWhy Root Election Matters
Campus Network with Access & Core LayersRoot Bridge should be Core switch to optimize paths
Old Access Switch becomes rootCan cause suboptimal traffic paths
Redundant Topology with High UptimeManual election avoids topology instability
Rapid PVST+ in VLAN-heavy networkSetting 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

SymptomLikely CauseCommand / Fix
Wrong switch is Root BridgeDefault priority too highLower priority with CLI
Loops observed during bootNo Root Bridge stabilitySet root bridge manually
Interfaces stuck in blockingWrong STP port rolesVerify with show spanning-tree
No STP seen on interfacesSTP disabled or BPDU filteredUse debug spanning-tree events
Unstable topology with frequent TCNsRoot flapping or election issuesLock 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 bridge
  • Root 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:

Class 1 CCNP Enterprise Course and Lab Introduction | FULL COURSE 120+ HRS | Trained by Sagar Dhawan
Class 2 CCNP Enterprise: Packet Flow in Switch vs Router, Discussion on Control, Data and Management
Class 3 Discussion on Various Network Device Components
Class 4 Traditional Network Topology vs SD Access Simplified

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.

Emailinfo@networkjourney.com
WhatsApp / Call: +91 97395 21088

Upskill now and future-proof your networking career!