Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Root Bridge Election

Direct answer

Rapid PVST+ elects the lowest Bridge ID independently for each VLAN. The effective Bridge ID combines configurable bridge priority, the VLAN extended-system ID, and the switch MAC address. Cisco root primary/root secondary are convenience calculations rather than a new election mechanism; the actual winner is still determined from the Bridge ID carried in BPDUs.

When to use this

Use it when the wrong switch is root for a VLAN, when traffic takes a detour through an access switch, or before adding a switch that could take over as root.

First 30 seconds

1. show spanning-tree vlan 10 root — root bridge ID and root port per VLAN.

2. Lowest bridge ID (priority + VLAN, then MAC) wins.

3. Set it deliberately: spanning-tree vlan 10 root primary or priority 4096.

Operational verification

configured priority per VLAN → lowest bridge ID (priority + VLAN ID, then MAC) → same Root ID seen on every switch in the VLAN → root ports point toward it → traffic path follows the tree

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE · Cisco IOS XE
Key commandshow spanning-tree vlan <vlan> detail
Scope / prerequisiteUse it when the wrong switch is root for a VLAN, when traffic takes a detour through an access switch, or before adding…
Show · 1Reference · 1
What next?3 suggested next steps
Catalog command links2
Evidence1
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

How to read the output

show spanning-tree vlan <vlan> detail

Look first: root ID, bridge ID, root port, interface role/state/cost

Healthy: Expected root and forwarding/blocking roles match design.

Warning: Unexpected root, topology changes, inconsistent/blocking state or wrong root port.

Does not prove: STP forwarding does not prove VLAN/trunk/L3/application correctness.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

6 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 First 30 seconds Verify boundary

Immediate answer: Verify the root ID, bridge priority and local root port for the exact VLAN before tuning STP cost or priority.

Verification chain: VLAN/instance → root bridge ID → local root port → designated/alternate roles → forwarding state → traffic

Stop condition: Correct root election does not show the chosen forwarding path is healthy or that every trunk carries the VLAN.

Step 2 Operational verification and known-good state Verify boundary
show spanning-tree vlan 10
show spanning-tree root
show spanning-tree bridge

In the first command, compare Root ID with Bridge ID. On the root they are identical and the line This bridge is the root is printed; on every other switch the Root ID block also shows Cost and Port — the root port. The second command lists root ID, cost and root port for every VLAN on one line each. The third shows the local priority per VLAN, which is how you confirm what was configured.

Known-good: the intended switch is root for every VLAN in use, the backup has the next-lowest priority, and all other switches are left at the default 32768.

Step 3 Verification & troubleshooting Narrow the fault

1. On any switch: show spanning-tree vlan <vlan> and note the priority and address under Root ID.

2. Find the switch that owns that address — on it, show spanning-tree bridge shows the same address and the VLAN output says This bridge is the root.

3. If that is not the intended switch, compare priorities and set a lower one on the intended root (and the next-lowest on the backup).

4. Run show spanning-tree root to check every VLAN in one table; a VLAN with a different root stands out.

Step 4 Failure signatures and troubleshooting branches Narrow the fault
  • Root is an access switch or an unknown device. Priorities were left at default, or a new switch with a lower priority or MAC was connected. Follow the root port hop by hop (show spanning-tree vlan <vlan> → Port → show cdp neighbors <port>) to find it.
  • Different root for some VLANs. The priority was configured for only part of the VLAN list.
  • Root moves back and forth. Two switches share the same priority and the link between them flaps, or the root is rebooting. show spanning-tree vlan <vlan> detail | include occurr|from shows when and from which port the last change came.
  • ROOT_Inc on a distribution port. A downstream switch claims to be root and Root Guard is holding it off; fix the downstream priority.
  • Paths changed after replacing the root switch. The new switch has a different MAC and priorities were equal; set an explicit priority.
Step 5 When the problem is really fixed Narrow the fault
  • The intended switch prints This bridge is the root for every VLAN in use.
  • The backup root has the next-lowest priority (show spanning-tree bridge).
  • Every other switch shows the same Root ID and a root port pointing toward it.
  • The topology-change counter has stopped increasing.
  • For each VLAN the root is the same switch as the active default gateway.
Step 6 Common mistakes Narrow the fault
  • Leaving priorities at default so the oldest switch becomes root.
  • Root not aligned with the HSRP active gateway.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

Lowest bridge ID wins: priority (multiples of 4096, default 32768) plus the VLAN ID, then lowest MAC address. The election is per VLAN and has no hold-down — a new switch with a lower bridge ID becomes root at once. Set the priority on the core switches on purpose; never leave it to the MAC address.

Key checks

show spanning-tree vlan 10 → Root ID vs Bridge ID; This bridge is the root on the intended switch. show spanning-tree root → root, cost and root port for every VLAN in one table. show running-config | include spanning-tree vlan → configured priorities.

ReferenceWhat it is1 section · depth on demand

What it is

The root bridge is the switch that every other switch in a VLAN measures its distance to. Spanning tree builds a loop-free tree by keeping, on each switch, the best path toward the root and blocking the rest. In Rapid PVST+ there is one election — and so possibly a different root — for every VLAN.

ReferenceWhy it matters1 section · depth on demand

Why it matters

The root decides the shape of the tree, and therefore which links carry traffic and which stand idle. If an access switch or an old switch in a wiring closet wins the election, traffic between two core switches may detour through it without anything looking broken. Placing the root on purpose — on a core or distribution switch, normally the one that is also the active default gateway for the VLAN — keeps the Layer 2 path and the Layer 3 path aligned.

ReferenceImportant terms & boundaries4 sections · depth on demand

Key points

  • Lowest bridge ID wins. Bridge ID = priority (steps of 4096) + extended system ID (the VLAN number) + MAC address.
  • Default priority is 32768, so with defaults the lowest MAC address — often the oldest switch — becomes root.
  • One election per VLAN: set the priority for every VLAN in use, not only VLAN 1.
  • There is no hold-down. A switch with a lower bridge ID becomes root as soon as it is connected.
  • root primary and root secondary are macros that set a priority once; they do not keep adjusting afterwards.
  • Root Guard on downstream-facing ports protects the placement you chose.

In depth

Root bridge election in Rapid PVST+

Each VLAN elects its own root bridge. The Catalyst 9300 STP guide states that the switch with the lowest priority becomes root, and that with default priorities the lowest MAC address wins. The priority is 32768 by default and set in steps of 4096 between 0 and 61440.

C9300-DIST-A(config)# spanning-tree vlan 10 root primary
C9300-DIST-B(config)# spanning-tree vlan 10 root secondary
C9300-DIST-A# show spanning-tree vlan 10 | include Root ID|Priority|This bridge
  Root ID    Priority    24586
             This bridge is the root
  Bridge ID  Priority    24586  (priority 24576 sys-id-ext 10)
C9300-ACC# show spanning-tree vlan 10 | include Root ID|Address|Cost|Port
  Root ID    Priority    24586
             Address     a4bb.6d11.2200
             Cost        2
             Port        2081 (Port-channel10)

How the priority values come about

ConfigurationPriority shown for VLAN 10
Default32768 + 10 = 32778
root primary24576 + 10 = 24586 (lower if another switch already has 24576 or less)
root secondary28672 + 10 = 28682
spanning-tree vlan 10 priority 40964096 + 10 = 4106

The guide describes root primary as lowering the priority to 24576 if needed, and root secondary as setting 28672.

Why set the root explicitly

Default electionExplicit root
Lowest MAC wins, often the oldest switch, possibly an access switchThe distribution or core switch with the best links
Root moves when a lower-MAC switch is addedStable

root primary calculates its value once. If a switch with a lower priority appears later, it doesn't adjust again. For a fixed result, set priorities explicitly (for example 4096 on the primary and 8192 on the secondary) and use root guard towards the access layer.

Verification

Check show spanning-tree root on every switch: all must agree on the root ID per VLAN.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

In Rapid PVST+, a root bridge is elected separately for each VLAN, using the same rule as classic STP: lowest bridge priority, then lowest MAC. Because the VLAN number is part of the priority (extended system ID), you can choose different roots for different VLANs.

spanning-tree mode rapid-pvst
spanning-tree vlan 10,30 root primary
spanning-tree vlan 20,40 root secondary
show spanning-tree summary

Documented example, not captured output.

When a better root appears, RSTP converges quickly through proposal/agreement, but traffic still shifts — configure roots deliberately instead of leaving defaults.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Mechanics and state ownership

Every switch starts out assuming it is the root and sends BPDUs that name its own bridge ID as the root. When a switch receives a BPDU naming a lower root ID, it stops claiming the role and instead passes on the better root's information with its own cost added. Within a few hello intervals every switch in the VLAN agrees on the lowest bridge ID.

Bridge IDs are compared as numbers, priority first. The priority can only be set in steps of 4096 because the lower 12 bits of the field carry the VLAN number (the extended system ID); that is why a switch configured with priority 4096 shows 4106 for VLAN 10. If two switches have the same priority, the lower MAC address wins.

spanning-tree vlan <vlan> root primary sets the priority to 24576, or to 4096 below the current root if that root is already at 24576 or lower. root secondary sets 28672. Both are one-time calculations — an explicit priority 4096 / priority 8192 on the two core switches is easier to read and to audit.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

Cisco IOS / IOS XE IEEE 802.1D-2004 / 802.1QFix the root and a backup root for VLAN 10

Assumptions: Lab switch; Rapid PVST+ (spanning-tree mode rapid-pvst); VLAN 10 exists.

! core switch 1
spanning-tree vlan 10 priority 4096
! core switch 2
spanning-tree vlan 10 priority 8192
!
! `spanning-tree vlan 10 root primary` is a macro that picks a priority lower than the current root; it does not track later changes.

Expected output

Cisco IOS / IOS XE IEEE 802.1D-2004 / 802.1Qshow spanning-tree vlan 10

Expected state: Root ID and Bridge ID are identical and the switch states that it is the root.

VLAN0010
  Spanning tree enabled protocol rstp
  Root ID    Priority    4106
             Address     0011.2233.4401
             This bridge is the root
  Bridge ID  Priority    4106   (priority 4096 sys-id-ext 10)
             Address     0011.2233.4401

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- ----
Gi1/0/1             Desg FWD 4         128.1    P2p
Gi1/0/2             Desg FWD 4         128.2    P2p
! Illustrative output, not captured Evidence.
Priority 4106 = configured 4096 + VLAN ID 10. All ports on the root are designated and forwarding; a root bridge has no root port.
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Switching → STP → RSTP — 802.1w → Rapid PVST+ → Root Bridge Election. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Embedded reference data

Quick lookup tables

Root Bridge Election operational reference

Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.

BoundaryKnown-good for Root Bridge ElectionSuspicious signatureNext proof
IntentMatches per-VLAN root election designConfiguration differs from peer/designCompare effective config
Control stateStable expected role/route/member statean unexpected Root ID, equal-priority tie resolved by MAC address, or a root change after adding/replacing a switchInspect protocol/RIB detail
ForwardingExpected egress/Port-Channel/VLAN pathState exists but traffic path disagreesFIB/MAC/adjacency
ClosureOriginal test passes for explained reasonSymptom merely moved or was bypassedRegression test
Confirmation

Confirm action

Continue?