Edge Port Security, Root Guard, and Loop Guard
CCNP Enterprise | Cisco CCNP 350-401 (ENCOR) & 300-410 (ENARSI)
This lab demonstrates how to protect a switched enterprise network from rogue devices, root bridge manipulation, and Layer 2 forwarding loops by combining PortFast, BPDU Guard, Root Guard, and Loop Guard.
Use the provided topology image for the lab.
G0/1G0/2G1/0G1/0G1/1G1/2
! On SW1 - access port toward PC1
conf t
interface g1/0
description User Access Port - PC1
switchport mode access
spanning-tree portfast
spanning-tree bpduguard enable
exit
! Optional global BPDU Guard on all PortFast ports
spanning-tree portfast bpduguard default
! Enable errdisable recovery for BPDU Guard
errdisable recovery cause bpduguard
errdisable recovery interval 300
end
! On SW2 - switch-facing public ports
conf t
interface g1/0
description Research
spanning-tree bpduguard enable
exit
! Enable errdisable recovery for BPDU Guard
errdisable recovery cause bpduguard
errdisable recovery interval 300
! On SW3 - downstream switch-facing ports
conf t
interface g1/1
description Link to SW4
switchport mode trunk
spanning-tree guard root
exit
interface g1/2
description Link to SW5
switchport mode trunk
spanning-tree guard loop
exit
! Optional global loop guard
spanning-tree loopguard default
end
! Test BPDU Guard
- Connect an unauthorized switch to SW2 G1/0
- Confirm the port transitions to err-disabled
! Test Root Guard
- Configure the downstream switch to advertise a superior bridge priority
- Confirm the port enters root-inconsistent state
! Test Loop Guard
- Stop or filter BPDUs on the redundant link
- Confirm the port enters loop-inconsistent state
| Check | Command | Expected Result |
|---|---|---|
| PortFast enabled | show spanning-tree interface g1/0 detail |
Interface shows PortFast mode |
| BPDU Guard active | show spanning-tree interface g1/0 detail |
BPDU Guard enabled on access port |
| Err-disabled port | show interfaces status err-disabled |
Port listed due to BPDU Guard violation |
| Errdisable recovery | show errdisable recovery |
bpduguard recovery enabled |
| Root Guard status | show spanning-tree inconsistentports |
Port shown as root-inconsistent |
| Loop Guard status | show spanning-tree inconsistentports |
Port shown as loop-inconsistent |
| STP details | show spanning-tree vlan 1 |
Root bridge and port roles verified |
errdisable recovery cause bpduguard and the timer value