Hands-On Lab: Configuring Root Guard

This hands-on lab configures Root Guard on switch ports facing access-layer switches to prevent an unauthorized or misconfigured switch from becoming the Spanning Tree root, verifying the port enters a root-inconsistent state when a superior BPDU is received.

Root Guard ConfigurationRoot-Inconsistent StateSTP Topology Protection

~3 min read · Updated Sep 23, 2026

Lab Objective

Configure Root Guard on a distribution switch's downlink ports toward access switches, verify normal operation is unaffected, then simulate an access switch attempting to become root and confirm Root Guard blocks it by placing the port into a root-inconsistent state.

Lab Purpose

Manually configuring root bridge priority, discussed earlier in this series, only controls the intended topology under normal conditions — it does nothing to prevent an access-layer switch from accidentally or maliciously advertising a lower priority and becoming root itself, which would disrupt the carefully designed traffic paths throughout the network. Root Guard enforces the intended root location at the port level.

Lab Topology

DistSwitch (intended root, priority 4096)
  ---- Gi1/0/1 ---- AccessSwitch1 (default priority)

VLAN 1 spans both switches

Task 1: Verify Normal Root Bridge Operation

Confirm DistSwitch is currently the root bridge and Gi1/0/1 is in the designated/forwarding role.

Task 2: Configure Root Guard on the Downlink Port

Enable Root Guard on DistSwitch's Gi1/0/1, the port facing AccessSwitch1.

Task 3: Verify Normal Traffic Is Unaffected

Confirm the port remains forwarding normally, since no superior BPDU is currently being received.

Task 4: Simulate AccessSwitch1 Attempting to Become Root

Lower AccessSwitch1's priority below DistSwitch's, simulating either a misconfiguration or an attack attempting to seize the root role.

Task 5: Verify Root Guard Blocks the Attempt

Confirm Gi1/0/1 enters a root-inconsistent state rather than allowing AccessSwitch1 to become root, and confirm DistSwitch remains root.

Solution and Verification

DistSwitch# show spanning-tree vlan 1 | include Priority

Bridge ID  Priority    4096
           This bridge is the root

DistSwitch# show spanning-tree vlan 1

Interface     Role  Sts  Cost   Prio.Nbr
Gi1/0/1       Desg  FWD  4      128.1

DistSwitch(config)# interface gigabitethernet1/0/1
DistSwitch(config-if)# spanning-tree guard root

DistSwitch# show spanning-tree vlan 1

Interface     Role  Sts  Cost   Prio.Nbr
Gi1/0/1       Desg  FWD  4      128.1
-- Still forwarding normally, no impact
-- under normal conditions

AccessSwitch1(config)# spanning-tree vlan 1 priority 0

-- 0 is the lowest possible priority,
-- guaranteed to win root election under
-- normal STP rules if Root Guard were not
-- present

DistSwitch# show spanning-tree vlan 1

Interface     Role  Sts        Cost   Prio.Nbr
Gi1/0/1       Desg  BKN*        4      128.1
*ROOT_Inc

DistSwitch# show spanning-tree inconsistentports

Name                 Interface        Inconsistency
VLAN0001             Gi1/0/1          Root Inconsistent
-- The port is blocked, and DistSwitch
-- remains the root bridge despite
-- AccessSwitch1's attempt

DistSwitch# show spanning-tree vlan 1 | include Priority

Bridge ID  Priority    4096
           This bridge is the root
-- Confirmed: DistSwitch is still root,
-- exactly as the network design intended

Key Takeaway

Root Guard does not simply ignore a superior BPDU — it actively places the receiving port into a distinct "root-inconsistent" blocking state, visible specifically in show spanning-tree inconsistentports, until superior BPDUs stop being received on that port, at which point it automatically recovers without requiring manual intervention.

Written & researched by Dr. Shahin Siami

Related Articles

Hands-On Lab: Configuring UDLD

This hands-on lab configures UDLD in aggressive mode on a fiber link between two switches, simulating a unidirectional fiber failure and verifying UDLD detects the mismatch and shuts down the affected port before a Layer 2 loop can form.

Continue

Hands-On Lab: Configuring Loop Guard

This hands-on lab configures Loop Guard on a switch's non-designated ports to prevent a unidirectional link failure from causing a Layer 2 loop, simulating a one-way BPDU loss and verifying the affected port enters a loop-inconsistent blocking state rather than incorrectly transitioning to forwarding.

Continue

Hands-On Lab: Configuring BPDU Guard and BPDU Filter

This hands-on lab configures BPDU Guard globally for PortFast-enabled ports and demonstrates the distinct, riskier behavior of BPDU Filter, comparing how each responds when a switch is connected to an access port that should only ever see end-user devices.

Continue

Hands-On Lab: Comprehensive Troubleshooting Challenge

This hands-on lab presents a multi-layer connectivity failure across VLANs, trunking, routing, and NAT simultaneously, requiring systematic bottom-up troubleshooting to identify and correct three independent faults before full connectivity is restored.

Continue

Hands-On Lab: Configuring Enhanced Object Tracking with HSRP

This hands-on lab configures IP SLA-based object tracking on an HSRP-enabled router, automatically lowering its priority when its WAN uplink fails, forcing failover to the standby router without requiring a full interface shutdown.

Continue

Hands-On Lab: Configuring Basic DMVPN (mGRE with NHRP)

This hands-on lab configures a basic single-hub DMVPN topology using a multipoint GRE tunnel and NHRP, demonstrating how a spoke dynamically registers its physical address with the hub without requiring a separate point-to-point tunnel per spoke.

Continue