< Home

Configuring BPDU Protection on a Switch

Context

Edge ports are directly connected to user terminals and, in most cases, will not receive BPDUs. However, attackers may send pseudo BPDUs to attack the switch with edge ports. In this case, if the edge ports receive the BPDUs, they are then configured as non-edge ports and spanning tree recalculation is triggered. Network flapping then occurs. Such attacks can be mitigated using BPDU protection on switches with edge ports.

Procedure

  1. Run system-view

    The system view is displayed.

  2. (Optional) Run stp process process-id

    The MSTP process view is displayed.

    Skip this step if you perform configurations in the MSTP process 0.

  3. Run stp bpdu-protection

    BPDU protection is enabled on the switch.

    By default, BPDU protection is not enabled on the switch.

Follow-up Procedure

If you want an edge port to automatically recover from the error-down state, run the error-down auto-recovery cause bpdu-protection interval interval-value command in the system view to configure the auto recovery function and set a recovery delay on the port. Then a port in error-down state can automatically go Up after the delay expires. Note the following when setting the recovery delay:
  • By default, the auto recovery function is disabled; therefore, the recovery delay parameter does not have the default value. When you enable the auto recovery function, you must set a recovery delay.
  • A smaller value of interval-value indicates a shorter time taken for an edge port to go Up, and a higher frequency of Up/Down state transitions on the port.
  • A larger value of interval-value indicates a longer time taken for the edge port to go Up, and a longer service interruption time.
  • The auto recovery function takes effect only for the ports that transition to the error-down state after the error-down auto-recovery command is run. To restore the port, the network administrator must manually run the shutdown and undo shutdown commands in sequence or run the restart command in the interface view.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >