Every Layer 2 Ethernet network running Spanning Tree Protocol (STP) relies on a single logical focal point: the root bridge. Because all loop-free forwarding paths are calculated relative to this switch, knowing which device holds the root role is essential for troubleshooting suboptimal traffic flows, unexpected link blocking, and topology flaps. On a Cisco switch, you can quickly verify whether your local chassis is the root bridge, inspect per-VLAN elections, trace an upstream root device across the network, and correct misconfigured priorities directly from the CLI.
Table of Contents
How to Verify If Your Local Cisco Switch Is the Root Bridge
To check whether the Cisco switch you are currently logged into is acting as the root bridge, inspect its spanning-tree state from privileged EXEC mode using two primary verification commands.
Step 1: Inspect the Detailed Spanning-Tree State
Run the base show spanning-tree command to view the election data and port states:
Switch# show spanning-tree
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 32769
Address 001c.58a1.b200
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 001c.58a1.b200
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
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
Look for three indicators in this output to confirm that the local switch is the root bridge:
- Explicit Root Declaration: Under the
Root IDheader, the third line explicitly statesThis bridge is the root. If another switch is the root bridge, this line is replaced byCostandPortentries pointing toward the upstream root. - Matching MAC Addresses: The hardware
Addresslisted underRoot ID(001c.58a1.b200) is identical to theAddresslisted under the localBridge IDsection. - All Designated Port Roles: In the interface table at the bottom, every active spanning-tree port displays a
RoleofDesg(Designated) in theFWD(Forwarding) state. A root bridge never has a port with theRootorAltn(Alternate/Blocking) role for that VLAN.
Step 2: Check the Multi-VLAN Root Summary Table
When a switch carries dozens of VLANs, scrolling through the full output is inefficient. Run show spanning-tree root to generate a condensed table showing the root status across all active VLANs at once:
Switch# show spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 32769 001c.58a1.b200 0 2 20 15 This bridge is the root
VLAN0010 24586 0024.97c4.1100 4 2 20 15 Gi1/0/24
VLAN0020 32788 001c.58a1.b200 0 2 20 15 This bridge is the root
Evaluate two columns in this summary view:
* Root Cost: A value of 0 confirms you are logged directly into the root bridge for that VLAN. Any non-zero number (such as 4 on VLAN0010) represents the cumulative path cost required to reach a remote root bridge.
* Root Port: If the local switch is the root, this column states This bridge is the root. Otherwise, it displays the local egress interface (such as Gi1/0/24) used to reach the upstream root switch.
Key Takeaway: Always check show spanning-tree root first for an immediate, multi-VLAN overview of whether Root Cost is 0 and Root Port reports This bridge is the root.
Understanding Root Bridge Election Fields: Priority, System ID, and MAC Address
While reading the show spanning-tree output above, several numerical fields—such as Priority 32769 and separate Root ID versus Bridge ID blocks—govern how the switch arrived at its current role. The following questions explain how Cisco switches calculate and compare these values.
What determines which Cisco switch becomes the root bridge?
Spanning Tree Protocol elects the root bridge by comparing the 8-byte Bridge ID (BID) advertised inside Configuration BPDUs by every switch in a broadcast domain. The switch with the lowest numerical Bridge ID wins the election. The Bridge ID is evaluated from left to right: first by comparing the 2-byte Priority field, and if priorities are equal, by comparing the 6-byte supervisor MAC address.
What is the difference between Root ID and Bridge ID in the CLI output?
- Root ID displays the priority, MAC address, and active STP timers of the switch that has currently won the election for that VLAN across the entire Layer 2 topology.
- Bridge ID displays the local switch’s own priority, MAC address, and configured timers for that VLAN. When the local switch is not the root, comparing
Bridge IDagainstRoot IDreveals whether your local switch lost the election due to a higher priority number or a higher hexadecimal MAC address.
Why does a Cisco switch display a priority like 32769 instead of 32768?
Modern Cisco switches run Per-VLAN Spanning Tree and enable the Extended System ID (spanning-tree extend system-id) by default so the chassis does not need to burn a separate hardware MAC address for every VLAN. This feature splits the 16-bit Priority field into a 4-bit Base Priority (configurable only in increments of 4096, with an IEEE 802.1D default of 32768) and a 12-bit Extended System ID carrying the VLAN number:
$$\text{Displayed Priority} = \text{Base Priority} + \text{VLAN ID}$$
For VLAN 1 at default settings, the displayed priority is $32768 + 1 = 32769$ (shown in the CLI as priority 32768 sys-id-ext 1). For VLAN 10, the default priority becomes $32768 + 10 = 32778$.
When does the MAC address decide the root bridge election?
If every switch on the network is left at the default base priority of 32768, every switch calculates the exact same total priority for a given VLAN. STP breaks this tie by electing the switch with the lowest hexadecimal MAC address. Because IEEE OUI blocks are assigned chronologically, the oldest switch on the network typically possesses the lowest MAC address—meaning an unconfigured network will almost always elect an aging, low-bandwidth access switch as its root bridge.
Key Takeaway: A switch wins the root bridge election by advertising the lowest total Bridge ID, which combines the base priority (in multiples of 4096), the VLAN ID, and the chassis MAC address as a tie-breaker.
CLI Templates to Check the Root Bridge for Specific VLANs
Because Cisco switches run Per-VLAN Spanning Tree (PVST+ or Rapid-PVST+) by default, different switches often act as the root bridge for different VLANs to load-balance uplinks. Use the following CLI templates to query individual VLANs and filter root status without scrolling through irrelevant data.
! 1. Check full root ID, local bridge ID, and port roles for a single VLAN
show spanning-tree vlan <vlan-id>
! 2. Check ONLY the winning Root ID, path cost, and root port for a specific VLAN or range
show spanning-tree vlan <vlan-id-or-range> root
! 3. Check ONLY the local switch's Bridge ID and priority for a specific VLAN
show spanning-tree vlan <vlan-id> bridge
! 4. Filter output across all VLANs to list only VLAN headers and root declarations
show spanning-tree | include ^VLAN|This bridge is the root|Root ID|Address
! 5. Filter the root summary table to show only VLANs where this switch is NOT the root
show spanning-tree root | exclude This bridge is the root
Replace <vlan-id> with a single number (such as 10) or <vlan-id-or-range> with a comma-separated list or hyphenated range (such as 10,20,30-40) to audit primary and secondary distribution switches side by side.
Key Takeaway: Scoping verification commands with the vlan <id> keyword and regex output filters (include/exclude) isolates per-VLAN root roles immediately in large Rapid-PVST+ topologies.
How to Trace a Remote Root Bridge Using the Root Port and CDP
When the local switch does not display This bridge is the root, you must trace the Layer 2 path upstream to find which physical chassis holds the root role. Follow these sequential steps to locate the remote root switch.
Step 1: Identify the Target Root MAC Address and Local Root Port
Run show spanning-tree vlan <vlan-id> on the local switch and note two pieces of data from the Root ID section: the root bridge’s MAC Address and the local Port pointing toward it.
Switch# show spanning-tree vlan 10
VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address 0024.97c4.1100
Cost 4
Port 28 (Port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Here, the remote root bridge has the MAC address 0024.97c4.1100, and the local switch reaches it out Port-channel1 (Po1).
Step 2: Resolve Port-Channels to Physical Interfaces
If the Root Port is a logical EtherChannel (Po1) rather than a standalone physical interface, identify its underlying physical member ports:
Switch# show etherchannel summary | include Po1
1 Po1(SU) LACP Gi1/0/23(P) Gi1/0/24(P)
Step 3: Query CDP or LLDP on the Physical Root Port
Use Cisco Discovery Protocol (CDP) or Link Layer Discovery Protocol (LLDP) on one of the physical root interfaces to identify the directly connected upstream switch and its management IP address:
Switch# show cdp neighbors GigabitEthernet1/0/23 detail
Device ID: DIST-SW01.corp.local
Entry address(es):
IP address: 10.10.1.2
Platform: cisco C9300-24T, Capabilities: Switch IGMP
Interface: GigabitEthernet1/0/23, Port ID (outgoing port): GigabitEthernet1/0/1
Step 4: Fallback to the MAC Address Table If CDP Is Disabled
In environments where CDP and LLDP are disabled for security, query the Layer 2 MAC address table for the Root ID MAC address (or inspect MAC addresses learned on the Root Port) to verify the forwarding path:
Switch# show mac address-table address 0024.97c4.1100
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
10 0024.97c4.1100 DYNAMIC Po1
Note: A Cisco switch uses a base chassis MAC pool for spanning-tree BPDUs that may differ by the last hex byte from its SVIs, or may only appear in the CAM table if it actively sources data-plane frames. Even if the exact STP base MAC is not cached in the CAM table, the Root Port identified in Step 1 (Po1) always points directly toward the root bridge.
Step 5: Hop to the Upstream Neighbor and Repeat
SSH into the upstream switch discovered in Step 3 (10.10.1.2) and run show spanning-tree vlan 10 root. If that switch reports This bridge is the root, you have found the physical root switch. If it lists another Root Port, repeat Steps 3 and 5 along each upstream Root Port until Cost reaches 0.
Key Takeaway: Following the Root Port upstream via show cdp neighbors <interface> detail will lead you directly to the physical root bridge in any loop-free topology.
How to Configure and Change the Root Bridge on a Cisco Switch
If your trace reveals that an access-layer closet switch has accidentally won the root election, you should immediately migrate the root role to your core or distribution switches. Follow this procedure to enforce a deterministic root bridge placement.
Step 1: Connect to the Intended Primary Core or Distribution Switch
Log into the switch that should act as the primary focal point for your topology (typically the same chassis acting as the active HSRP, VRRP, or GLBP default gateway for those VLANs) and enter global configuration mode:
Core-SW01# configure terminal
Step 2: Set the Root Bridge Using Either a Macro or Static Priority
You can promote the switch using one of two configuration methods. Avoid mixing both methods across the same VLANs.
Option A: Set a Static Priority Value (Recommended Best Practice)
Setting a low, explicit priority value guarantees that the switch remains the root bridge even if other switches with modified priorities are later introduced into the network. Priority values must be entered in increments of 4096 (from 0 to 61440):
! On the Primary Core Switch (sets base priority to 4096)
Core-SW01(config)# spanning-tree vlan 1-100 priority 4096
! On the Secondary/Redundant Core Switch (sets base priority to 8192)
Core-SW02(config)# spanning-tree vlan 1-100 priority 8192
Option B: Use the root primary and root secondary Macros
Alternatively, Cisco provides a one-time configuration macro that inspects the current Root ID on the wire at the moment you press Enter:
! On the Primary Core Switch
Core-SW01(config)# spanning-tree vlan 1-100 root primary
! On the Secondary/Redundant Core Switch
Core-SW02(config)# spanning-tree vlan 1-100 root secondary
When you execute root primary, the switch checks the current root bridge’s base priority:
* If the current root’s base priority is higher than 24576 (such as the default 32768), the macro writes spanning-tree vlan <id> priority 24576 into the running configuration.
* If the current root’s base priority is already 24576 or lower, the macro sets the local switch’s priority to 4096 less than the current root (down to a minimum of 4096).
* The root secondary macro statically sets the local base priority to 28672, assuming the rest of the network remains at the default 32768.
Step 3: Verify the Election and Save the Configuration
Exit configuration mode, verify that the local switch has preempted the old root bridge, and write the changes to NVRAM:
Core-SW01(config)# end
Core-SW01# show spanning-tree vlan 10 root
Core-SW01# copy running-config startup-config
Key Takeaway: Explicitly configuring priority 4096 on your primary core switch and priority 8192 on your secondary core switch provides deterministic root bridge placement that will not be overridden by default switches.
Cisco CLI Command Reference and Platform Variations
This reference defines the complete syntax modifiers for spanning-tree verification across Cisco operating systems and highlights behavior differences between Cisco Catalyst (IOS / IOS XE) and Cisco Nexus (NX-OS) platforms.
Command Syntax Specification (Cisco IOS / IOS XE)
show spanning-tree [active | backbonefast | blockedports | bridge | detail | inconsistentports | interface <type> <number> | mst | pathcost method | root | summary | uplinkfast | vlan <vlan-id>]
Verification Modifier Definitions
active: Displays spanning-tree information exclusively for interfaces that are currently up and participating in STP forwarding or blocking states.blockedports: Lists only interfaces currently held in a blocking or discarding state by STP.bridge: Displays only the local switch’s Bridge ID, priority, MAC address, and STP timer parameters across active instances.detail: Outputs comprehensive per-port diagnostics, including BPDU transmit/receive counters, port path cost, port identifier, and designated bridge/root IDs advertised on each segment.inconsistentports: Lists interfaces placed into aRoot-Inconsistent(via Root Guard) orLoop-Inconsistent(via Loop Guard) blocking state.mst: Displays Multiple Spanning Tree Protocol (IEEE 802.1s) instance mappings, regional root IDs, and internal Spanning Tree (IST) status when runningspanning-tree mode mst.root: Displays only the elected Root ID, root path cost, root timers, and local Root Port per VLAN.summary: Displays global STP operational mode (PVST+, Rapid-PVST+, or MSTP), extended system ID state, PortFast defaults, and aggregate port state counts per VLAN.
Platform Comparison: Cisco IOS XE vs. Cisco NX-OS
| Attribute | Cisco Catalyst (IOS / IOS XE) | Cisco Nexus (NX-OS) |
|---|---|---|
| Default STP Mode | rapid-pvst (IEEE 802.1w per VLAN) | rapid-pvst (IEEE 802.1w per VLAN) |
| Check Root Summary | show spanning-tree root | show spanning-tree root |
| Check Specific VLAN | show spanning-tree vlan <id> | show spanning-tree vlan <id> |
| Check MSTP Root | show spanning-tree mst [<instance-id>] | show spanning-tree mst [<instance-id>] |
| Root Cost Calculation Default | Short (32-bit, 10 Gbps = 2) unless spanning-tree pathcost method long is configured | Short by default; supports spanning-tree pathcost method long (20 Gbps = 1000, 10 Gbps = 2000) |
| Virtual Port-Channel (vPC) Root Behavior | N/A (Uses StackWise Virtual / VSS, acting as a single control plane) | Dual control plane; requires spanning-tree pseudo-information when aligning Root ID across vPC peers |
| Official Cisco Documentation Reference | Cisco IOS LAN Switching Command Reference (show spanning-tree chapter) | Cisco Nexus 9000 Series NX-OS Layer 2 Switching Command Reference |
Key Takeaway: While basic show spanning-tree root and vlan <id> commands are identical across IOS XE and NX-OS, always account for pathcost calculation methods and vPC pseudo-information configurations when auditing hybrid Catalyst and Nexus data centers.
Auditing your spanning-tree root bridge should be a routine part of any Cisco network health check. By starting with show spanning-tree root to verify local root costs, understanding how Base Priority and Extended System ID form the Bridge ID, tracing unexpected Root Ports upstream via CDP, and locking in explicit priorities on your core switches, you ensure your Layer 2 topology stays predictable, resilient, and loop-free.











Comments