← Common fixesTroubleshooting

Wrong switch elected as spanning-tree root

Spanning tree always elects a root. The question is whether it elected the one you want. The root is the switch with the lowest bridge ID (priority then MAC). Leave priorities at the default and the oldest switch with the lowest MAC wins, which is rarely where you want the root. You fix it by setting priority on purpose.

What it means

Every path in the spanning tree is calculated toward the root bridge, so the root's location decides which links forward and which block. The bridge ID is priority (default 32768) plus the MAC address. Equal priorities means the lowest MAC breaks the tie (an accident of hardware age, not design), so traffic between access switches can be forced across a poor path.

Most common causes

  • Default priorities everywhere. All switches at 32768, so the lowest MAC wins the election. That's almost never the switch you'd choose as root.
  • Priority set on the wrong switch. A low priority left on a switch that shouldn't be root (or a stale `root primary` from an old design) pins the root in the wrong place.
  • Per-VLAN root not considered. With per-VLAN spanning tree, the root is elected per VLAN. Setting priority for the wrong VLAN leaves the real traffic VLAN rooted somewhere else.

How to fix it

  1. Decide which switch should be root (usually the distribution/core switch).
  2. Lower its priority for the VLAN: `spanning-tree vlan <id> priority 4096` (or `root primary`).
  3. Confirm with `show spanning-tree` that the intended switch is now root.
  4. Check that one link in any loop is blocking. The topology should stay loop-free.