The BPDU guard function is to set the port to error-disabled immediately when it receives any BPDU.
We know that when the STP function of the switch is enabled, all ports will participate in STP by default, and send and
Accept BPDU. When BPDU guard is enabled, under normal circumstances, a downstream dormitory port will not receive
Any BPDU, because both the PC and the small switch do not support STP, do not send and receive BPDU. When this port is
If a self-loop exists, the BPDU sent out by it will be received by itself after the loop is rolled back on the small switch,
At this time, bpduguard will set it to error-disabled immediately, which is equivalent
If it is disabled and no data is forwarded, the loop is cut off to protect the entire network.
When the BPDU guard feature is enabled, the port enters the err-Disable state when receiving the BPDU, thus avoiding bridging loops.
Generally, BPDU guard is used in combination with portfast. After portfast is enabled on the port, if the BPDU guard is not enabled, STP will bring the port into the blocking state when the port receives the BPDU, after BPDU guard is configured, the port enters err-Disable when it receives the BPDU. Configure BPDU
Port-Based Configuration:
Switch (config-If) # spanning-tree bpduguard enable
Switch (config-If) # spanning-tree bpduguard disable
Global Configuration:
Switch (config) # spanning-tree portfast bpduguard
The global configuration is used with portfast. When portfast is enabled on the port, BPDU guard is enabled for this port. If portfast is not enabled for this port, this command will not enable BPDU guard for this port.
Conclusion: After BPDU guard is configured, only the BPDU are sent and not received. when received, the port enters the err-Disable state.