Spanning Tree (STP) lab practice
Keep redundant switch links without a Layer 2 loop: root bridge election, port roles and states, Rapid PVST+, PortFast and BPDU Guard.
7 labs · 10 lessons · 4 commands · 4 projects
Redundant links between switches create loops, and Ethernet frames have no time-to-live, so a loop becomes a broadcast storm within seconds. Spanning Tree Protocol prevents it by electing a root bridge and blocking just enough ports to leave one loop-free path.
On the CCNA you need to read the election (lowest bridge ID wins), the port roles and states, and to control the outcome: place the root deliberately, run Rapid PVST+, and protect edge ports with PortFast and BPDU Guard.
Hands-on labs
- Spanning-Tree (STP) Basics (free)
- STP Root Bridge Election (free)
- Root Bridge Primary and Secondary (free)
- Rapid Spanning-Tree (RSTP) (free)
- Rapid PVST With Deliberate Root Placement (free)
- Multiple Spanning Tree Mode (free)
- STP Loop Prevention Repair (Pro)
Lessons, in order
- Spanning Tree (STP) (2. Network Access, 21 min)
- STP Roles & States (2. Network Access, 9 min)
- Rapid PVST+ & PortFast (2. Network Access, 7 min)
- Read the trunk table and see how a Layer 2 loop forms (2. Network Access, 11 min)
- Read show spanning-tree to find the root and port roles (2. Network Access, 11 min)
- Switch to Rapid PVST+ (2. Network Access, 11 min)
- Pin the root bridge with root primary and secondary (2. Network Access, 11 min)
- Enable PortFast on edge ports (2. Network Access, 11 min)
- Protect edge ports with BPDU Guard (2. Network Access, 13 min)
- Choose the STP protection that matches the failure (2. Network Access, 12 min)
Commands
- show spanning-tree — Shows, per VLAN, the root bridge, this switch’s bridge ID, and every port’s STP role, state and cost.
- show spanning-tree vlan — Shows the spanning-tree instance for one VLAN: root bridge, local bridge ID and port roles and states.
- show spanning-tree summary — Shows the STP mode, which protections are enabled globally, and a count of ports in each state per VLAN.
- show spanning-tree root — Lists the root bridge ID, root cost and root port for every VLAN on one screen.
Related projects
- Redundant Switching and Spanning Tree — Calloway Printworks lost a morning's production when a single uplink failed. Cable its three switches in a triangle so there is always a second path, run rapid PVST+, and decide which switch is root instead of letting the oldest one win.
- Redundant Campus Uplinks with STP Root Bridge Placement & PortFast — A financial analytics office suffered a network outage when a rogue switch was connected into a conference room, hijacking root bridge status. You must harden Spanning Tree across dual distribution switches by enforcing deterministic Root and Backup Root priorities and enabling edge PortFast with BPDU Guard.
- Hotel Floor Switches: Moving the Spanning-Tree Root to the Core — A hotel has a core switch in the comms room (CORE-SW, with the property-management and guest-portal servers) and a switch in a cupboard on each of two floors, each floor uplinked to the core, with a riser cable between the two floors for redundancy. A contractor's test last month left the floor-1 switch at priority 4096 for both VLANs, so it became the root, and floor-2 traffic now detours through the floor-1 cupboard. Put the root back on the core, remove the contractor's override, make sure floor traffic goes straight to the core, and give every host port PortFast.
- Dual-Stack Collapsed-Core Campus with Per-VLAN Root Placement — An engineering firm is replacing a flat office network before its IPv6 rollout. The new design is a collapsed core: two core switches (CORE-01 and CORE-02, cross-linked) and two access switches, each access switch dual-homed to both cores. Everything is cabled and the hosts are addressed (IPv4 by hand, IPv6 set to autoconfigure); the switches are factory-fresh. This change window covers phase 1: VLANs, trunks, a deterministic spanning tree, and IPv4 and IPv6 gateways on CORE-01. Gateway redundancy across both cores is phase 2 (the HSRP project), so CORE-02 is the backup root but not yet a gateway.