Use it on all host-facing ports, and when a port is err-disabled and you need to know why and how to bring it back.
BPDU Guard
BPDU Guard puts a port into err-disabled state as soon as it receives a spanning-tree BPDU. It is used on PortFast access ports so a switch plugged in by mistake cannot change the topology or create a loop.
BPDU Guard active on the port (interface, or global default + PortFast) → BPDU received → port err-disabled, log message → remove the device or loop → shut/no shut or automatic recovery → port forwarding again
Identify the downstream BPDU source/topology, correct it, then recover intentionally.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
spanning-tree bpduguard enablePrimary Commands
Configuration and operational commands for this Topic.
spanning-tree bpduguard enableReferenceEnable BPDU Guard on an interface.
Use when: Protect an edge port from unexpected received BPDUs.
Quick note: Investigate BPDU source before recovery.
Cisco IOS XE · mixedspanning-tree portfast bpduguard defaultReferenceEnable BPDU Guard on all PortFast ports globally.
Use when: Enforce edge BPDU protection consistently.
Quick note: Audit PortFast scope and use err-disable/log evidence for incidents.
Cisco IOS / IOS XE · mixedShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
show errdisable recoveryShowShows supported err-disable causes and automatic recovery status/interval.
Use when: Determine whether BPDU Guard or another cause is eligible for automatic recovery and when.
Quick note: Also check interface err-disabled status and logs/cause.
Cisco IOS XE · mixedshow interfaces status err-disabledShowList interfaces currently disabled by err-disable protection.
Use when: Quickly identify ports disabled by BPDU Guard or other err-disable causes.
Quick note: Identify exact cause, correct it, then recover intentionally.
Cisco IOS XE · mixedHow to read the output
show interfaces status err-disabledLook first: line/protocol state, errors/discards, rate, duplex/speed, last input/output
Healthy: State and counters align with expected traffic and physical conditions.
Warning: CRC/input errors, drops, resets, queue drops or unexpected negotiation.
Does not prove: An interface counter is a symptom until correlated with path/time/workload.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 First 30 seconds Verify boundary
Immediate answer: Check whether a BPDU was received on the protected edge port and whether that event actually drove the port into err-disabled state.
Verification chain: edge intent → BPDU Guard scope → received BPDU → err-disable reason → recovery policy → restored edge behavior
Stop condition: An err-disabled port with BPDU Guard configured does not show BPDU Guard caused the event until the recorded reason/counters agree.
Step 2 Operational verification and known-good state Verify boundary
show spanning-tree summary
show spanning-tree interface Gi1/0/5 detail
show interfaces status err-disabled
show errdisable recovery
The summary tells whether the global default is on. The interface detail prints Bpdu guard is enabled when the port is protected by either form. The third command lists ports that are down and why; the fourth shows whether bpduguard is among the causes that recover automatically, and the timer.
Known-good: host ports are protected, no port is err-disabled for bpduguard, and the recovery setting is a deliberate choice.
Step 3 Verification and output interpretation Verify boundary
Check interface status, err-disable reason, logs and spanning-tree details. A BPDU-Guard event shows a BPDU was received on a protected port; it does not by itself identify whether the sender was a rogue switch, an accidental bridge, a phone/hypervisor behavior change or a cabling move. Correlate the event with neighbor discovery, MAC learning and physical topology.
Step 4 Step-by-step troubleshooting Narrow the fault
Boundary rule: An err-disabled port with BPDU Guard configured does not show BPDU Guard caused the event until the recorded reason/counters agree.
Step 5 Verification & troubleshooting Narrow the fault
1. show interfaces status err-disabled → the port and the reason bpduguard.
2. show logging | include BPDUGUARD → when it happened.
3. Find out what was connected — the port is down, so CDP is gone; use the log, the patch record or the user.
4. Remove the switch or the loop.
5. shutdown then no shutdown on the port, or wait for automatic recovery.
6. show spanning-tree interface <port> detail → Bpdu guard is enabled confirms the protection is still in place.
Step 6 Failure signatures and troubleshooting branches Narrow the fault
- Port err-disabled, reason bpduguard, after a user added a desktop switch. Working as intended; remove the device.
- The port trips again every five minutes. Automatic recovery is on and the cause is still connected.
- An uplink to a real switch is err-disabled. The link runs in access mode and was caught by the PortFast and BPDU Guard defaults; configure it as a proper inter-switch link.
- A switch was plugged into an access port and nothing happened. The guard is not active there: the port is not a PortFast port (global form), or BPDU Filter is configured on it.
- Phones or PCs alone never trigger it. They do not send BPDUs; if one does, it is bridging.
Step 7 When the problem is really fixed Narrow the fault
- The cause — switch or patch loop — has been removed, not just the port re-enabled.
- The port is up and
Bpdu guard is enabledstill shows in its detail view. show interfaces status err-disabledlists no bpduguard entries.- The log shows no repeat after one recovery interval.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
A BPDU on a guarded port err-disables the whole port immediately. The global command (portfast bpduguard default) only covers PortFast ports; the interface command guards the port regardless of PortFast. The port stays down until shutdown/no shutdown or err-disable recovery — remove the offending switch or loop first, or it trips again.
show interfaces status err-disabled → port and reason bpduguard. show logging | include BPDUGUARD → when it happened. show errdisable recovery → whether automatic recovery is on and the timer. show spanning-tree summary → global BPDU Guard default.
ReferenceWhat it is1 section · depth on demand
What it is
BPDU Guard shuts a port down — puts it in err-disabled state — the moment a spanning-tree BPDU arrives on it. It is used on ports where no switch should ever be connected.
ReferenceWhy it matters1 section · depth on demand
Why it matters
An access port is a promise that only an end device sits behind it. Someone who plugs in a small switch, or patches two wall outlets together, breaks that promise: the new device could change the topology, even become root, or close a loop. BPDU Guard turns that into a contained and logged event that costs one port, instead of a problem for the whole VLAN.
ReferenceImportant terms & boundaries6 sections · depth on demand
Key points
- Global:
spanning-tree portfast bpduguard default(newer IOS XE:portfast edge bpduguard default) — covers ports that are operating as PortFast ports. - Interface:
spanning-tree bpduguard enable— covers the port whether or not PortFast is on. - Action: the whole port is err-disabled, for all VLANs, and
%SPANTREE-2-BLOCK_BPDUGUARDis logged. - Recovery:
shutdown/no shutdown, or automatic witherrdisable recovery cause bpduguard(interval 300 seconds by default). - BPDU Filter on the same interface wins: the guard never sees a BPDU.
- Different from Root Guard: any BPDU triggers it, and the port goes down rather than blocking.
In depth
BPDU guard: shut down an edge port that receives a BPDU
The Catalyst 9300 optional STP features guide describes two ways to enable BPDU guard:
| Form | Applies to | Effect of a received BPDU |
|---|---|---|
Global: spanning-tree portfast bpduguard default | Ports in PortFast operational state | The port is error-disabled |
Interface: spanning-tree bpduguard enable | That port, with or without PortFast | The port is error-disabled |
The guide states that recovery is manual unless you configure otherwise. errdisable detect cause bpduguard shutdown vlan limits the shutdown to the offending VLAN.
C9300(config)# spanning-tree portfast default
C9300(config)# spanning-tree portfast bpduguard default
C9300(config)# errdisable recovery cause bpduguard
C9300(config)# errdisable recovery interval 300
%SPANTREE-2-BLOCK_BPDUGUARD: Received BPDU on port Gi1/0/10 with BPDU Guard enabled. Disabling port.
%PM-4-ERR_DISABLE: bpduguard error detected on Gi1/0/10, putting Gi1/0/10 in err-disable state
C9300# show interfaces status err-disabled
Port Name Status Reason Err-disabled Vlans
Gi1/0/10 Desk 2.14 err-disabled bpduguard
C9300(config)# interface GigabitEthernet1/0/10
C9300(config-if)# shutdown
C9300(config-if)# no shutdown
Why it's essential on access ports
| Event | Without BPDU guard | With BPDU guard |
|---|---|---|
| A user connects a small switch with a loop | Broadcast storm, possibly a new root bridge | Port shut down at the first BPDU |
| A misconfigured host bridges two NICs | Loop between two access ports | Ports shut down |
Automatic recovery
errdisable recovery cause bpduguard re-enables ports after the interval. That's convenient, but a looping device will be shut down again on every recovery. Find and remove the device rather than relying on recovery.
Where not to use it
Not on uplinks or links to other switches: they're supposed to send BPDUs.
Documented example, not captured output.
Quick reference
BPDU Guard err-disables a port the moment it receives a BPDU. On PortFast ports that should only have end devices, a BPDU means someone connected a switch, which could otherwise create a loop or change the root.
spanning-tree portfast bpduguard default
errdisable recovery cause bpduguard
errdisable recovery interval 300
show interfaces status err-disabled
Documented example, not captured output.
Recover a port with shutdown/no shutdown after removing the cause, or let errdisable recovery re-enable it.
Mechanics and state ownership
The check happens when a BPDU is received, before spanning tree acts on its contents. It makes no difference whether the BPDU is better or worse than the current root — its mere presence proves a bridge is attached. The port is handed to the err-disable mechanism: the link is taken down, so every VLAN on the port, including a voice VLAN, loses connectivity.
With automatic recovery the port is re-enabled after the interval. If the offending device is still there, the next BPDU disables it again, and the log shows the port cycling every five minutes — a pattern worth recognising.
The two forms differ in scope. The global default only protects ports that are currently operating as edge ports, so a port without PortFast is not covered by it. The interface command protects the port unconditionally. On trunks, some platforms can limit the action to the offending VLAN with errdisable detect cause bpduguard shutdown vlan.
State model and protocol mechanics
BPDU Guard protects an edge-designated port by reacting to received BPDUs. On Cisco switching it commonly places the interface into an err-disabled state, preventing an unexpected switch from participating in the Layer-2 topology through a port that was intended for an endpoint.
Limits and common misconceptions
Do not treat BPDU Guard as a substitute for correct STP root placement or for loop-free design. Disabling the guard to restore service can expose the topology to the condition it was designed to contain. An err-disabled port is an enforcement outcome, not evidence of a physical fault. Automatic err-disable recovery may restore forwarding while the violating condition still exists.
ReferenceConfiguration & state1 section · depth on demand
Design and configuration model
Use BPDU Guard where the topology contract says that receiving a BPDU is itself a policy violation. It is commonly paired with PortFast on endpoint-facing access ports. Decide whether the policy is enabled per-interface or as a default for PortFast-enabled ports, and keep recovery behavior intentional rather than relying on automatic recovery without correcting the cause.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Lab switch; Rapid PVST+ (spanning-tree mode rapid-pvst); VLAN 10 exists.
spanning-tree portfast default
spanning-tree portfast bpduguard default
!
! or per interface, independent of PortFast:
interface GigabitEthernet1/0/5
spanning-tree bpduguard enable
!
errdisable recovery cause bpduguard
errdisable recovery interval 300Expected output
show interfaces status err-disabledExpected state: Failure signature after a switch was plugged into a host port.
%SPANTREE-2-BLOCK_BPDUGUARD: Received BPDU on port Gi1/0/5 with BPDU Guard enabled. Disabling port.
%PM-4-ERR_DISABLE: bpduguard error detected on Gi1/0/5, putting Gi1/0/5 in err-disable state
Port Name Status Reason
Gi1/0/5 err-disabled bpduguard
! Illustrative output, not captured Evidence.The log line names the port and the cause. The port is down for all VLANs until it is recovered; find what sent the BPDU before re-enabling.Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Switching → STP → STP Enhancements → BPDU Guard. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%Quick lookup tables
BPDU Guard · operational reference
Compact state and interpretation boundaries for fast lookup.
| State / evidence | Interpretation |
|---|---|
| Protected edge | BPDUs should not appear |
| BPDU received | Policy violation detected |
| Err-disabled | Protection action |
| Recovery | Requires cause awareness |
BPDU Guard operational reference
Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.
| Boundary | Known-good for BPDU Guard | Suspicious signature | Next proof |
|---|---|---|---|
| Intent | Matches fail-closed protection that disables an edge port when a BPDU violates the endpoint-only assumption design | Configuration differs from design/peer | Compare effective configuration |
| Control state | Stable expected region/role/topology/path state | an access port repeatedly entering err-disabled because a downstream bridge sends BPDUs, BPDU Guard missing from an edge policy, or automated recovery restoring a dangerous topology before the attached device is corrected | Inspect protocol detail and adjacent state |
| Forwarding | Expected VLAN/egress/RIB/FIB path | Control state exists but traffic path disagrees | MAC/FIB/CEF/adjacency proof |
| Closure | Original test passes for explained reason | Symptom moved, was bypassed or protection disabled | Regression test |