NEW350+ rooms now have a live terminal, so you can learn by typing the commands, right in your browser.Learn in a live terminal. 350+ rooms.Try a lab♥ Codelivly is 100% free, no paywall. If it helped you, chip in to keep it running.100% free. Help keep it so.Support us
[>_] ROOM · Networking
Spanning Tree Protocol (STP)
Master Spanning Tree Protocol (STP), root bridge election, RSTP convergence, and Layer 2 security features like BPDU Guard to prevent network loops.
Room tasks
1What Is Spanning Tree and Why Does It Matter
2STP Port States & Root Bridge Election
3RSTP and Rapid Convergence
4STP Security Features
5Guided Lab: Diagnosing and Fixing an STP Loop
Frequently Asked Questions
What is Spanning Tree Protocol used for?
STP prevents switching loops in Ethernet networks that have redundant links. It blocks certain ports so only one active path exists, which stops broadcast storms while keeping backup links ready for failover.
How is the root bridge elected in STP?
Switches exchange BPDUs and compare bridge IDs, which combine priority and MAC address. The switch with the lowest bridge ID becomes the root bridge, and every other switch calculates its best path toward it.
What does BPDU Guard do?
BPDU Guard shuts down an access port if it receives a BPDU, which prevents rogue switches from changing the topology. It is a core Layer 2 security feature, and this room on Codelivly covers it for free.