A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
Sometimes STP doesn't pick the port you wanted. The cost says one thing, your design says another. You can override the cost on a per-port basis, or you can nudge priorities and let STP do the math. This lesson covers both — and the tiebreaker chain that decides when everything else is equal.
When two paths have the same cost, STP falls through a series of tiebreakers in order. Stop at the first one that breaks the tie.
The receiver port ID tiebreaker is the one people forget. If two uplinks from the same switch connect to the same neighbor switch with identical costs, STP uses the local port number (Gi0/1 before Gi0/2) as the final discriminator. This is why port naming order matters in a design.
! Manually set cost on a specific portSW1(config)# interface gigabitEthernet0/1SW1(config-if)# spanning-tree cost 100! Verify the new cost took effectSW1# show spanning-tree interface gigabitEthernet0/1 detail | include costPort path cost 100, Port path cost method long
Setting cost to 100 on a 1 Gbps link makes it look to STP as if it's a 100 Mbps equivalent. If you want STP to prefer a different path, either lower the cost on the path you want, or raise the cost on the path you don't. Both achieve the same effect.
Never raise the cost on a path so high that the port becomes alternate unless that's the intent. You might inadvertently disconnect a segment. Always predict the outcome on paper, or test in a lab, before pushing a cost change in production.
Port priority is 0–255, but only the high 4 bits are used for the actual priority (so values are 0, 16, 32, 48, ... 240). Lower is better. When two ports on the same switch connect to the same segment (rare but possible with EtherChannel), port priority breaks the tie.
SW1(config)# interface gigabitEthernet0/1SW1(config-if)# spanning-tree port-priority 32
The root has cost 0. Each subsequent switch adds its ingress port's cost. The cumulative cost tells you which path is 'closest' to the root. If SW4 had a second path via a 10 Gbps link directly to SW1, that path would cost 2,000 (10G ingress) — much lower than 12 (or 12,000 in modern units) through SW2 and SW3. SW4 would pick the direct 10G path as its root port.
Cost manipulation is a design tool, not a fix. Before changing cost, ask why STP picked the path it did. The answer usually points to a design issue — the wrong switch becoming root, or cabling that doesn't match the intended topology. Fix the design first; tweak cost only if the design is already correct but STP's choice is still off.
Finish the lesson once you have worked through the material. This awards ★ 30 XP.