STP / RSTP / MST Reference
Cheat sheet · https://pcornel.dk/topic.php?topic=200
Answer
Spanning tree prevents loops in a switched network with redundant links: the switches elect a root, each keeps its best path to it, and the remaining redundant ports are blocked. STP, RSTP and MST differ in how fast they react and how many trees they run.
Remember
A blocked redundant port is spanning tree working. Set the root on purpose — otherwise the switch with the lowest MAC address wins. Run a rapid mode everywhere, and make ports to end devices edge ports with spanning-tree portfast.
First checks
show spanning-tree summary— the mode in use.show spanning-tree vlan <id>— root, this switch's root port, and each port's role and state.show spanning-tree root— root and root port for every VLAN.show spanning-tree vlan <id> detail | include changes|from— topology changes and where the last one came from.
Verify in this order
mode consistent across switches → intended root elected per VLAN → root port = intended uplink on each switch → redundant ports blocked → edge ports on end devices → topology change count stable
Where it usually breaks
physical link → switchport/bundle membership → VLAN/instance state → STP/LAG decision → MAC forwarding → end-to-end frame path
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=200