Troubleshooting notes · Switching
A desk switch became spanning-tree root: PortFast without BPDU guard
A switch plugged into a user port takes over as spanning-tree root for the whole network. Why PortFast alone protects nothing, and how BPDU guard shuts the rogue switch out. Real output from Cisco IOS XE 17.18.
The symptom
Traffic takes strange paths, and the root bridge is a switch nobody planned: someone's desk switch, plugged into a user port. On the access switch, the root port points at that desk port:
SW2# show spanning-tree vlan 1 | include Root ID|Priority|Address|Port
Root ID Priority 1
Address aabb.cc00.2300
Port 7 (Ethernet1/2)
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address aabb.cc00.2200
SW2# show running-config interface Ethernet1/2
Building configuration...
Current configuration : 110 bytes
!
interface Ethernet1/2
description User port (desk 12)
switchport mode access
spanning-tree portfast
end
Why it happens
The desk switch has priority 0, lower than the core switch's 4096, so it wins the root election as soon as its BPDUs are accepted. The user port has PortFast, but PortFast only skips the listening and learning states. It doesn't block anything: a PortFast port that receives a BPDU just becomes a normal spanning-tree port and takes part in the election. BPDU guard is what protects a user port: it err-disables the port as soon as a BPDU arrives.
The fix
Add BPDU guard to the user port (better: to every PortFast port, with spanning-tree portfast bpduguard default):
SW2(config)# interface Ethernet1/2
SW2(config-if)# spanning-tree bpduguard enable
At the next BPDU from the desk switch, the port goes err-disabled. That's the intended result: the rogue switch is shut out, and the planned root takes over again.
Check it
show spanning-tree vlan 1 should show the planned root's priority, and show interfaces status err-disabled should list the desk port with reason bpduguard. To bring the port back once the desk switch is gone: shutdown, then no shutdown, or set up errdisable recovery cause bpduguard.
Practise this fault
This fault is in CCNA Lab 13 of CCNA Troubleshooting Labs: a ready-made GNS3 project where you find and fix it yourself, alongside the other faults in the ticket, with the tested solution.
Or start with 15 free labs (5 each from CCNA, ENARSI and ENCOR), by email:
We’ll email you the download links and occasional lab tips. Unsubscribe with one click, any time. Your address is never shared.