BPDU guard

term

networking

Kept in this browser · My desk

A spanning tree protection that disables an edge port, one meant for a host, the moment it receives a BPDU, because a BPDU means a switch is connected there.

An edge port (Cisco's PortFast) goes straight to forwarding, which is right for a host and dangerous for a switch. BPDU guard closes the gap: a BPDU on such a port error-disables it, so a switch plugged in under a desk cannot join the tree or close a loop through it. Juniper calls it BPDU protection (bpdu-block-on-edge); Arista notes that a port it disables stays down until someone re-enables it. The site's spanning tree and layer 2 redundancy articles compare it across vendors.

What it is. BPDU guard is a spanning tree protection that disables an edge port, one meant for a host, the moment a BPDU (bridge protocol data unit) arrives on it, on the reasoning that a BPDU means a switch is connected where only a host should be. It is a vendor feature built on top of the standard rather than part of it: the IEEE (Institute of Electrical and Electronics Engineers) 802.1Q management model has no guard setting, and its own reaction to a BPDU on an edge port is gentler, the operational edge status simply becomes false and the port rejoins the tree as an ordinary port.

Why edge ports need it. An edge port (Cisco's PortFast) goes straight to forwarding, which is right for a host and dangerous for a switch. Edge ports exist so that hosts do not wait through listening and learning and do not send topology changes that shorten every MAC (media access control) table's ageing, one of Cisco's three causes of unicast flooding. Without BPDU guard, an edge port facing a second switch skips the very checks that would have blocked a loop. BPDU guard closes the gap with a blunt rule: a BPDU on such a port error-disables it, so a switch plugged in under a desk cannot join the tree or close a loop through it.

On the wire. The trigger is any frame addressed to the Bridge Group Address 01-80-C2-00-00-00 carrying a valid BPDU, a configuration BPDU of 35 bytes, a four-byte topology change notification or a rapid spanning tree BPDU; the content does not matter, unlike root guard, which compares priorities. The Linux bridge shows how simple the check is: before it parses a received BPDU, it tests the port's guard flag and, if set, logs that a BPDU was received on a blocked port and disables the port.

On each platform. Cisco: enabled globally it applies to every port in a PortFast operational state, enabled per interface it puts the port in the error-disabled state, and the interface must be put back in service by hand. Juniper calls it BPDU protection (bpdu-block-on-edge): an edge interface that receives a BPDU is disabled and the error must be cleared, unless a disable-timeout clears it automatically. Arista notes that a port it disables stays down until someone re-enables it. Fortinet's FortiSwitchOS requires the port to be an edge port with STP (Spanning Tree Protocol) enabled on the interface and globally, takes it down for a set time, 5 minutes by default and up to 120, does not forward the BPDUs, and offers execute bpdu-guard reset and diagnose bpdu-guard display status. Linux has IFLA_BRPORT_GUARD, off by default, for ports facing devices that may send BPDUs and cause network failure.

History. Sean Convery's Black Hat USA 2002 slides for Cisco list BPDU guard among the answers to spanning tree attacks, enabled on all ports running PortFast, with its first releases: CatOS 5.4.1 for Catalyst 2000, 4000, 5000 and 6000, native IOS 12.0XE on the 6000, and 12.1 releases for the 3550 and 2950. The same slides warn against the opposite reflex: do not disable spanning tree, because a loop would become another attack.

Why it matters for storms, and its limits. BPDU guard only reacts to BPDUs: a hub or an unmanaged switch that drops BPDUs, or a cable looped back on itself through such a device, sends none, which is why vendors add probe-based loop detection (Aruba's loop-protect is documented for exactly those ports). Its action is also a lever: whoever can send a BPDU into an edge port can shut that port. The National Vulnerability Database (NVD) record CVE-2019-15265 describes Cisco Aironet access points that forwarded BPDUs from certain wireless clients incorrectly, so a stream of crafted BPDUs could put an access point's port into the error-disabled state, a limited denial of service. Where nobody can re-enable a disabled port quickly, Cisco's 2008 campus design guide prefers root guard on access ports; a timeout, as on Juniper and Fortinet, trades a slower response to a real switch for automatic recovery from a nuisance.

Neighbours, kept apart. BPDU filtering looks similar and does the opposite on a switch-facing port: it hides BPDUs and can create loops. Root guard blocks a port only against a superior root claim and recovers by itself. Loop guard keeps a blocked port from forwarding when BPDUs stop. Loop detection sends probes of its own.

Also known as: bpduguard, bpdu protection, bpdu-block-on-edge

Sources

← Back to B Back to the glossary