root guard

term

networkingsecurity

Kept in this browser · My desk

A spanning tree port setting that keeps a port from ever becoming the path to the root: if a better root claim arrives on it, the port is blocked instead of the tree moving.

Cisco places such a port in the root-inconsistent (blocked) state; Juniper's root protection moves it to a root-prevented state and returns it to forwarding automatically when the superior BPDUs stop; the IEEE 802.1Q model calls the control restrictedRole, under which the port becomes an Alternate Port rather than a Root Port; the Linux bridge calls it root port guard. It is disabled by default on Cisco's Catalyst 9300.

What it is. Root guard is a spanning tree port setting that keeps a port from ever becoming the path to the root bridge: if a better root claim arrives on it, the port is blocked instead of the tree moving. It is configured on ports that face places the administrator does not control, so that the root, and with it the shape of every forwarding path, stays where it was designed to be.

Why it exists. The spanning tree root is whoever announces the lowest bridge identifier, and nothing in a BPDU (bridge protocol data unit) is authenticated; Phrack's 2003 analysis of STP (Spanning Tree Protocol) attacks starts from that absence of authentication, and Juniper's documentation names the threat as a bridge application on a PC that interferes with root port election. Cisco's 2002 tests, presented by Sean Convery at Black Hat USA, showed a root claim drawing traffic through the claimant and reducing a gigabit backbone to 10 Mb half duplex; the attacker had to be dual-homed to two switches, or to one through a hub. The Yersinia framework (2005) put STP attacks in a menu. Setting the root's priority decides among your own switches; root guard on downlinks to places you do not control is what stops a stranger.

The identifier, field by field. In the IEEE (Institute of Electrical and Electronics Engineers) 802.1Q model the bridge priority is a 4-bit value from 0 to 15, default 8, and lower values indicate the better identifier; it is followed by a 12-bit system identifier extension (0 to 4095, the VLAN or instance on per-VLAN implementations) and the bridge's 48-bit MAC (media access control) address. The priority therefore moves in steps of 4,096, and the default 8 appears as 32768, 0x8000, which is exactly what Phrack's 2003 capture prints: root 8000.00:50:e2:bd:58:40. A worked comparison: the designed root sends 1000.00-00-5E-00-53-01 (priority 4096); a PC on an access port starts sending BPDUs claiming root 0000.00-00-5E-00-53-66 (priority 0). Zero is lower, so the claim is superior, and without protection every switch would recompute the tree around the PC. With root guard on that access port the switch blocks the port for as long as the superior BPDUs keep arriving, and the rest of the tree never hears about them.

On each platform. Cisco places such a port in the root-inconsistent (blocked) state, and root guard is disabled by default on the Catalyst 9300. Juniper's root protection moves it to a root-prevented state, blocks it only for the spanning tree instances on which superior BPDUs arrive, returns it through listening and learning to forwarding automatically when they stop, and cannot be combined with loop protection on the same interface. Fortinet's FortiSwitchOS has the port ignore or drop superior BPDUs, so that it never becomes the path to root, and says to enable it on all ports that should not lead to the root bridge but never on the root port, with STP enabled. The IEEE model calls the control restrictedRole: the port becomes an Alternate Port rather than a Root Port, even with the best priority vector, at the risk of a lack of spanning tree connectivity. The Linux bridge calls it root port guard (IFLA_BRPORT_PROTECT), meant for ports facing a hostile guest.

Where to put it. Cisco's 2008 campus design guide recommends root guard or BPDU guard on every access port, BPDU guard only where someone can re-enable disabled ports, since root guard recovers by itself. In practice that means access ports and any downlink towards equipment outside the administrator's control, never the ports that lead towards the designed root.

What goes wrong. Root guard on a port that leads to the real root blocks the legitimate path, which is the loss of connectivity the IEEE text warns about; after a redesign that moves the root, the old guards must move too. It protects the root's position, not the network from every BPDU: an inferior claim passes, a stream of topology change notifications still flushes tables (the IEEE's restricted-tcn setting handles that), and a loop through the guarded port is still a loop. One divergence in the record: Cisco's 2008 guide describes root guard as reacting to inferior BPDUs, while Cisco's own 17.12 guide, Juniper, Fortinet and the IEEE model describe the trigger as a superior root claim, which is the behaviour described here.

Neighbours. BPDU guard shuts a host port on any BPDU; BPDU filtering hides BPDUs and can create loops; loop guard keeps a blocked port blocked when BPDUs stop; topology change notification is the flush root guard does not stop. Also spanning tree, STP and RSTP (Rapid Spanning Tree Protocol).

Also known as: root guard, root protection, restricted role, root port guard, root-inconsistent

Sources

← Back to R Back to the glossary