Another Security Blog

A place to show my mad skills

TidBits Walkthroughs Resources Projects View on GitHub
30 May 2025

TB - GNS3 Lab: Spanning Tree Protocol (STP) with Root Guard

by C. Casquatch

Rooooooooooooooooooooooot

Lab by: https://gns3vault.com/switching/spanning-tree-root-guard

🛡️ Lab Goal


🖥️ Lab Topology

Screenshot topology


1️⃣ Basic Setup

On all 3 switches:

conf t
hostname SWx         ! Replace x with 1, 2, or 3
no ip routing
vlan 1
exit

Enable trunking and interfaces:

interface range gi0/0 - 3
 no shutdown
 switchport
 switchport mode trunk

2️⃣ Configure STP Priorities

On SW2 (Root Bridge):

conf t
spanning-tree vlan 1 priority 0
end

On SW3 (Secondary, but not root):

conf t
spanning-tree vlan 1 priority 4096
end

3️⃣ Enable Root Guard on SW1

Apply Root Guard on ports Gi0/2 and Gi0/3 (facing SW3):

conf t
interface range gi0/2, gi0/3
 spanning-tree guard root
end

4️⃣ Verify Spanning Tree Role

Run the following on all switches:

show spanning-tree vlan 1

Screenshot 1 Screenshot 2 Screenshot 3


5️⃣ Test Root Guard

Temporarily force SW3 to claim root:

conf t
spanning-tree vlan 1 priority 0
end

Then on SW1:

show spanning-tree inconsistentports

✅ Ports Gi0/2 and Gi0/3 should be in root-inconsistent state.

Screenshot 4


6️⃣ Revert and Verify

Restore SW3 to priority 4096:

conf t
spanning-tree vlan 1 priority 4096
end

Verify STP and ensure interfaces return to forwarding state.

Screenshot 4


✅ Lab Complete

tags: GNS3 - root guard - Networking - spanning-tree