free lab · CertCrack Packet Tracer Labs · All labs

Lab 9: Spanning Tree — Elect a Root, Block the Loop

CCNA domain: Domain 2 · Network Access (Spanning Tree)  ·  Difficulty: Intermediate  ·  Time: ~40 minutes  ·  Devices: 3 switches (2960), 2 PCs

Three switches wired in a triangle give you two paths between everything — wonderful for surviving a failed link, fatal the moment a broadcast frame starts circling. Ethernet has no TTL, so loops do not fade away; they become storms. Spanning Tree Protocol is the negotiation that keeps the redundancy and kills the loop: the switches elect one root bridge, measure their cheapest path to it, and park exactly the right port in blocking. In this lab you will first switch STP off and meet the storm it prevents, then run the election yourself — and finally rig the re-election so the root lands where you want it.

Your progress on this lab

0 of 6 tasks done — tick tasks off as you finish them; progress is saved in this browser.

What you need

Topology

SW1MAC 0001.C911.1111SW2MAC 0001.C922.2222SW3MAC 0001.C933.3333PC0192.168.1.10PC1192.168.1.20Fa0/1 ↔ Fa0/1Fa0/2 ↔ Fa0/1Fa0/2 ↔ Fa0/2

Three switches, three inter-switch links, two PCs. The switch MAC addresses are printed on the diagram because they decide the first election: with every priority left at the default, the lowest MAC in the triangle — SW1's 0001.C911.1111 — is crowned root. The ports are FastEthernet, so every hop costs 19. Notice what is not in the diagram: a blocked port. Which one blocks, and why that one, is the lab.

DeviceInterfaceConnects toNotes
SW1Fa0/1SW2 Fa0/1Bridge ID 32769 / 0001.C911.1111 — lowest MAC in the triangle
SW1Fa0/2SW3 Fa0/1
SW1Fa0/24PC0Access port
SW2Fa0/1SW1 Fa0/1Bridge ID 32769 / 0001.C922.2222 — becomes root in Task 5
SW2Fa0/2SW3 Fa0/2
SW3Fa0/1SW1 Fa0/2Bridge ID 32769 / 0001.C933.3333 — highest bridge ID
SW3Fa0/2SW2 Fa0/2Hosts the blocking port in the first election
SW3Fa0/24PC1Access port
PC0FastEthernet 0192.168.1.10 /24No gateway — same subnet as PC1
PC1FastEthernet 0192.168.1.20 /24No gateway — same subnet as PC0

Tasks

Build the topology first, then work through the tasks in order. Try each task from memory before you open the commands — that is how the skill sticks. Click Show commands only when you are stuck or to check your work.

Task 1 — Close the triangle — then break it on purpose

Build the triangle: SW1–SW2, SW1–SW3 and SW2–SW3, with PC0 on SW1 and PC1 on SW3. Address the PCs (192.168.1.10 and 192.168.1.20, /24 — same subnet, so no gateway exists or is needed). Ping PC0 → PC1: it works, and the triangle looks harmless. It is not. Ethernet frames have no TTL, so a broadcast that gets into a loop never dies — it just multiplies. Normally the switches' built-in STP quietly prevents that. To see what STP saves you from, switch it off on SW3, then open Packet Tracer's Simulation mode, send one ping from PC0, and watch copies of the same frames chase each other around the triangle while the switches' MAC tables flap between ports:

On SW3:
no spanning-tree vlan 1

PC0 > Desktop > Command Prompt:
ping 192.168.1.20

Then watch in Simulation mode — one broadcast becomes a storm.

Task 2 — Turn STP back on — explicitly

That storm is why Spanning Tree Protocol exists: switches exchange BPDUs, agree on a single reference point (the root bridge), and deliberately block the ports that would complete a loop. On real 2960s STP runs by default as PVST+ (one spanning-tree instance per VLAN, so each VLAN can have its own root and its own blocked port). 'On by default' is no excuse for not knowing it is there — make the mode explicit on all three switches and bring SW3 back into the tree:

On SW1:
spanning-tree mode pvst

On SW2:
spanning-tree mode pvst

On SW3:
spanning-tree vlan 1
spanning-tree mode pvst

Task 3 — Read the bridge IDs and predict the root

Every switch advertises a bridge ID: its priority (default 32768, changeable only in multiples of 4096) with the VLAN number added by the system ID extension — 32769 for VLAN 1 — followed by its MAC address. The lowest bridge ID wins the root election: priority first, MAC as the tiebreak. Run show spanning-tree on each switch, harvest the three bridge IDs (SW1 ends .1111, SW2 .2222, SW3 .3333), and write down your prediction before you check: with all priorities equal, SW1's lower MAC should have won. Then find 'This bridge is the root' on SW1 and confirm.

On SW1:
show spanning-tree

On SW2:
show spanning-tree

On SW3:
show spanning-tree

Task 4 — Verify every port role

Now account for all nine triangle ports. Each switch picks a root port — its cheapest path to the root (each FastEthernet hop costs 19). Designated ports forward for their segment; the one port left over blocks. You should find: SW1 (root) all Desg FWD; SW2's Fa0/1 is its Root port, Fa0/2 Designated; SW3's Fa0/1 is its Root port (straight to the root, cost 19) and Fa0/2 sits in BLK — it lost the designated election for the SW2–SW3 segment on bridge ID, so it is the loop-breaker. Exactly one port blocks. That is a healthy tree.

On SW2:
show spanning-tree

On SW3:
show spanning-tree

Task 5 — Move the root to SW2 with a priority change

An election won by an accident of MAC addresses is not a design. Make SW2 — the switch in the middle of your diagram — the root on purpose: drop its VLAN 1 priority to 4096, the lowest standard step. Its bridge ID falls to 4097 and beats every 32769 on the floor. Give the tree up to a minute to reconverge (listening and learning states take 15 seconds each), then re-read the roles: SW1's Fa0/1 becomes a Root port; SW3 now reaches the root fastest through SW2, so its Fa0/2 becomes its Root port and the blocking job moves to SW3's Fa0/1. The blocked port follows the root — always.

On SW2:
configure terminal
spanning-tree vlan 1 priority 4096
end

On SW1:
show spanning-tree

On SW3:
show spanning-tree

Task 6 — Final verification — one path, one blocked port

Close it out. PC0 → PC1 must ping cleanly, travelling PC0 → SW1 → SW2 → SW3 → PC1 through forwarding ports only. Sweep show spanning-tree on SW3 one last time and count the tree's state: root = SW2 (priority 4097), SW3's Fa0/2 Root FWD, Fa0/1 in BLK — still exactly one blocking port in the whole triangle, just standing guard on a different door. Redundancy intact, loop impossible.

On SW3:
show spanning-tree

PC0 > Desktop > Command Prompt:
ping 192.168.1.20

Verification

Run these checks from the switch CLIs (and a PC command prompt where noted). Your output should match the description — wording may vary slightly by Packet Tracer version.

Exam connection

Spanning Tree is core Domain 2 (Network Access) material, and the exam tests the reasoning, not the button-pushing: root election by bridge ID (priority in multiples of 4096, MAC as tiebreak), root / designated / blocking port roles, port cost by speed, and PVST+ running one instance per VLAN. Know why a blocked port still hears BPDUs, why an accidental root bridge hurts, and why RSTP replaced 30–50 second waits with near-instant convergence. If you can predict the tree before you run the command, the exam questions become free marks — warm up with the free 30-question CCNA practice sample and the CCNA 200-301 guidebook.

Turn lab skills into exam marks

Nine labs in — one to go. The capstone lab breaks a network in four places and hands you the wrench. After that, prove the skills with the free practice sample: same topics, exam wording, timed pressure.

Free CCNA SampleCCNA Guidebook

FAQ

How does STP choose the root bridge?

By the lowest bridge ID. The bridge ID is the configured priority (default 32768, changeable only in multiples of 4096) plus the switch's MAC address, with the system ID extension adding the VLAN number — so a default VLAN 1 bridge ID reads 32769. If every switch runs the default priority, the oldest switch with the lowest MAC address wins, which is why 'the root is whatever it is' is an accident, not a design. Pin the root deliberately on a strong, central switch and set a secondary as backup.

Why does a port block even though the link is perfectly healthy?

Blocking is the entire point of STP. Between any two switches there can be only one active path, so the port that would complete a loop stops forwarding user traffic. It is not dead, though: it still receives BPDUs, and if the active path fails, STP promotes the blocked port to forwarding automatically — that patience is your free redundancy.

My root bridge is a random access switch in a closet. Does it matter?

Yes. Every frame between other switches hairpins through the root, so a weak or badly placed root adds hops, becomes a traffic bottleneck, and turns its own reboot into a full-network reconvergence. Choose the root on purpose — a core or distribution switch — with spanning-tree vlan 1 priority, and give the intended backup the next value up (8192), so failover lands somewhere sane.

← Previous labLab 8: PAT Overload & a Standard ACL Next lab →Lab 10: Find the Fault — Troubleshooting Capstone

More free tools

Packet Tracer LabsAll 10 free CCNA hands-on labs Subnet CalculatorNetwork, broadcast & host ranges from any IP/CIDR Subnetting PracticeTimed subnet drills with worked solutions OSI Model QuizLearn the 7 layers and test yourself All Free ToolsThe CertCrack tools hub