STP port roles and the root bridge
Find the root bridge and work out why a port does not forward.
A port can have carrier without forwarding traffic. After a change in the switching topology, spanning tree can put a redundant port in blocking or discarding state.
Identify the root bridge
# Cisco
show spanning-tree root
show spanning-tree vlan 20 detail | include root|Root
# Linux bridge
bridge -d link show
cat /sys/class/net/br0/bridge/root_id
# MikroTik
/interface bridge monitor br0
The bridge with the lowest Bridge ID wins. Priority is compared first and the MAC address breaks a tie among equal priorities.
Read the port roles
| Role | Meaning |
|---|---|
| Root | The switch's best path toward the root. |
| Designated | The forwarding port for the segment on the far side. |
| Alternate | A backup path that normally discards data frames. |
| Edge | A host-facing port that starts forwarding without the usual delay. |
Set the intended topology
- Set the root and standby root priorities explicitly.
- Use edge or PortFast on ports intended for end hosts.
- Use BPDU Guard where a received BPDU should disable an edge port.
- Use Root Guard where a downstream switch should never advertise a better root.
spanning-tree mode rapid-pvst
spanning-tree vlan 1-4094 priority 4096
interface range Gi1/0/1-44
spanning-tree portfast
spanning-tree bpduguard enable