Hands-On Lab: Configuring Loop Guard

This hands-on lab configures Loop Guard on a switch's non-designated ports to prevent a unidirectional link failure from causing a Layer 2 loop, simulating a one-way BPDU loss and verifying the affected port enters a loop-inconsistent blocking state rather than incorrectly transitioning to forwarding.

Loop Guard ConfigurationLoop-Inconsistent StateUnidirectional Link Failure

~3 دقیقه مطالعه · آخرین به‌روزرسانی ۱ مهر ۱۴۰۵

Lab Objective

Configure Loop Guard on a switch's alternate (blocking) port in a redundant topology, simulate the loss of incoming BPDUs on that port without the link itself failing, and verify Loop Guard prevents the port from incorrectly transitioning to forwarding.

Lab Purpose

Root Guard, discussed in an earlier lab, protects against a port receiving a superior BPDU it should not. Loop Guard protects against the opposite problem: a port that stops receiving BPDUs entirely due to a unidirectional link failure, which would otherwise cause STP to incorrectly assume the alternate path is safe to activate, creating an actual Layer 2 loop.

Lab Topology

Switch1 ---- Gi1/0/1 ---- Switch2 (designated/forwarding)
Switch1 ---- Gi1/0/2 ---- Switch2 (alternate/blocking,
                          redundant link)

Task 1: Verify Current Port Roles

Confirm Gi1/0/1 is forwarding and Gi1/0/2 is in the alternate/blocking role.

Task 2: Configure Loop Guard on the Blocking Port

Enable Loop Guard on Gi1/0/2.

Task 3: Simulate a Unidirectional BPDU Loss

Simulate the scenario where Gi1/0/2 stops receiving BPDUs (representing a unidirectional fiber failure or similar) without the interface itself going administratively or physically down.

Task 4: Verify Loop Guard Prevents Incorrect Forwarding

Confirm the port enters a loop-inconsistent state rather than transitioning to forwarding as it normally would once BPDUs stop arriving.

Task 5: Restore BPDU Reception and Verify Recovery

Restore normal BPDU reception and confirm the port automatically returns to its correct blocking role.

Solution and Verification

Switch1# show spanning-tree vlan 1

Interface     Role  Sts  Cost   Prio.Nbr
Gi1/0/1       Root  FWD  4      128.1
Gi1/0/2       Altn  BLK  4      128.2

Switch1(config)# interface gigabitethernet1/0/2
Switch1(config-if)# spanning-tree guard loop

-- Simulated: Gi1/0/2 stops receiving BPDUs
-- (unidirectional failure) while remaining
-- physically/administratively up

-- Without Loop Guard, STP would normally
-- interpret the absence of BPDUs as "the
-- upstream device is gone" and transition
-- this port to forwarding after the max
-- age timer expires -- creating an actual
-- loop, since Gi1/0/1 is still forwarding too

Switch1# show spanning-tree vlan 1

Interface     Role  Sts        Cost   Prio.Nbr
Gi1/0/1       Root  FWD         4      128.1
Gi1/0/2       Altn  BKN*        4      128.2
*LOOP_Inc

Switch1# show spanning-tree inconsistentports

Name                 Interface        Inconsistency
VLAN0001             Gi1/0/2          Loop Inconsistent
-- The port is held in blocking rather than
-- being allowed to transition to forwarding,
-- exactly preventing the loop that would
-- otherwise form

-- BPDU reception restored on Gi1/0/2

Switch1# show spanning-tree vlan 1

Interface     Role  Sts  Cost   Prio.Nbr
Gi1/0/1       Root  FWD  4      128.1
Gi1/0/2       Altn  BLK  4      128.2
-- Automatically recovered to its correct
-- alternate/blocking role once BPDUs
-- resumed, no manual intervention required

Key Takeaway

Loop Guard and Root Guard, covered in an earlier lab, protect against opposite failure directions on opposite port roles: Root Guard is applied to designated ports to reject unexpected superior BPDUs, while Loop Guard is applied to non-designated (alternate/backup) ports to prevent them from incorrectly transitioning to forwarding when BPDUs simply stop arriving — Cisco recommends applying Loop Guard specifically on all non-designated ports of switches with redundant links, a broader scope than the single-port examples shown in these labs.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Hands-On Lab: Final Comprehensive CCNP Troubleshooting Challenge (BGP, DMVPN, and QoS Integration)

This hands-on lab presents a complex multi-layer failure across an integrated BGP-over-DMVPN topology combined with QoS marking, requiring systematic diagnosis of a route reflector misconfiguration, an NHRP registration failure, and an incorrectly applied QoS policy simultaneously affecting the same network.

ادامه

Hands-On Lab: Configuring BGP over DMVPN

This hands-on lab runs iBGP as the routing protocol across the same DMVPN hub-and-spoke topology used in the two previous labs, configuring the hub as a route reflector so spokes learn each other's routes without a full iBGP mesh, combining two previously separate concepts into one integrated design.

ادامه

Hands-On Lab: Configuring OSPF over DMVPN

This hands-on lab runs OSPF as the dynamic routing protocol across the same DMVPN hub-and-spoke topology, configuring the tunnel interface as an OSPF point-to-multipoint network type to correctly handle the hub-and-spoke adjacency pattern without requiring the broadcast network type's DR/BDR election.

ادامه

Hands-On Lab: Configuring EIGRP over DMVPN

This hands-on lab runs EIGRP as the dynamic routing protocol across the DMVPN hub-and-spoke topology built in earlier labs, verifying neighbor relationships form correctly across the multipoint tunnel and routes propagate without requiring per-spoke static configuration on the hub.

ادامه

Hands-On Lab: Configuring HSRP MD5 Authentication

This hands-on lab configures MD5 authentication on an HSRP group, verifying two routers with matching authentication strings form a normal active/standby relationship while a router with a mismatched string is excluded from the group entirely.

ادامه

Hands-On Lab: Configuring Cisco Umbrella-Style DNS Security via DNS Forwarding Redirection

This hands-on lab configures a router to redirect all client DNS queries toward a security-focused DNS resolver using DNS forwarding interception, approximating cloud-delivered DNS security enforcement without requiring per-client configuration changes.

ادامه