Lion Cipher Lab
Build a Linux bridge, watch spanning tree block a loop, and stop a rogue bridge
- Cyber / Security Engineer
- Intermediate
- ~60 min
- Free · no account required
Why it matters
Ethernet has no TTL. A frame that is sent round a loop between switches keeps going and a broadcast multiplies until the network is down. Spanning tree is the protocol that finds loops and blocks one link on purpose. It is also a trust problem: any device that can send spanning tree messages can take part in the election, and a bridge with a good enough priority becomes the root and pulls traffic through itself. Defenders turn spanning tree on where there are redundant links, then protect the edge so only switches they own can speak it. You will do both on your own machine in about an hour,…
What you'll learn
- building two software switches and a deliberate loop between them with network namespaces and veth pairs
- turning on spanning tree and reading which bridge is root and which port is blocking
- watching a blocked port take over when the active link fails
- explaining why a bridge with the lowest priority wins the root election, and what that lets a rogue device do
- using the port guard and root_block settings, the Linux version of BPDU guard and root guard
Steps in this lab
- Why a network with a loop needs spanning tree
- Check your kernel and create three namespaces
- Join sw1 and sw2 with two cables, a deliberate loop
- Wait for the election, then read which port is blocking
- Prove traffic crosses, then break the active cable
- Bring the cable back, then attach a rogue bridge
- Protect the port: guard on stops a bridge you did not expect
- What a professional does differently
- Clean up
Open the full interactive lab →