BPDU Guard

  • Have you ever wondered what BPDU Guard is and how it protects your network?
    Let’s make it simple and start with an example.

    In the diagram above, we see a typical STP topology with three switches: SW1, SW2, and SW3.

    STP topology where a rogue switch becomes Root Bridge after sending a BPDU – example of what BPDU Guard prevents

    Figure 1 – Rogue switch sends BPDUs to claim Root Bridge role

    • SW1 is the Root Bridge, with Bridge ID 32769:AABB.CCDD.EE01

    • SW2 has a port (G0/2) configured with PortFast, normally meant for end devices.

    But here's the problem:

    A rogue switch gets connected to that access port. Instead of staying quiet, it sends BPDUs with a lower Bridge Priority: 4096:AABB.CCDD.EE10 better than the current Root Bridge.

    Since BPDU Guard is not enabled, SW2 accepts the BPDU and forward the BPDU into the STP topology.

    Without BPDU Guard

    The Rogue Switch win Root Bridge Election because it advertises a better priority 4096 against SW1 priority 32769, it’s now selected as the new Root Bridge.

    What is BPDU Guard: rogue switch becomes Root Bridge by using a lower Bridge ID in STP topology

    Figure 2 – Rogue switch becomes Root Bridge by sending superior BPDUs

    Your entire Spanning Tree topology is now compromised and all of this started from a single access port not properly secured. This is exactly what BPDU Guard feature is designed to prevent.

    Solution: Enabling BPDU Guard

    To prevent this situation, BPDU Guard must be applied to the PortFast-enabled port.
    BPDU Guard discard any incoming BPDU and placed the port into an err-disable state (down/down).

    This ensures that access ports typically connected to end-user devices like PCs or printers can’t participate in STP.

    With BPDU Guard

    Let's review our example with BPDU Guard enabled on the interface connected to the rogue switch.

    What is BPDU Guard: port G0/2 disabled after rogue switch sends BPDU, blocked by BPDU Guard

    Figure 3 – BPDU Guard blocks the rogue switch by shutting down the interface

    The BPDU Guard feature detects the incoming BPDU on the interface and immediately disables the port to protect the network.

    *Dec  8 12:58:28.065: %SPANTREE-2-BLOCK_BPDUGUARD: Received BPDU on port Gi0/2 with BPDU Guard enabled. Disabling port.
    
    *Dec  8 12:58:28.066: %PM-4-ERR_DISABLE: bpduguard error detected on Gi0/2, putting Gi0/2 in err-disable state
    
    *Dec  8 12:58:29.073: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down
    
    *Dec  8 12:58:30.109: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to down

    As you can see above, BPDU was received on interface G0/2 with BPDU Guard enabled, this event trigger the shutdown of the interface.

    Answer the question below