Lessons · Network switches · BPDU guard
The port that must never see another switch
BPDU guard shuts a port down the moment it receives a spanning tree message, because a desk port should never hear one.
Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.
What it is for
Somebody plugs a cheap switch or a looped patch lead into a desk port, and the whole network suffers. BPDU guard turns that into one dead port instead.
How to think about it
Put it on every access port that has portfast. The pair belongs together: portfast says 'there is one host here', BPDU guard enforces it.
Worked example
enableThe # prompt.
configure terminalInto configuration mode.
interface gi0/4The desk port.
switchport mode accessAccess.
spanning-tree portfastNo wait, because there is one host here.
spanning-tree bpduguard enableAnd if that turns out to be false, the port goes down rather than the network.
endOut.
show running-configBoth lines under the interface. This pair is what an access port should look like on a network anybody can reach.
Your turn
Shut this port if it ever hears a spanning tree message.
spanning-tree bpduguard
Console into a switch
The trap
Putting it on an uplink. Uplinks are supposed to receive spanning tree messages, so BPDU guard there disables the link to the rest of the building the moment it comes up.