CCNA 200-301

CCNP Enterprise

CCNP Security

CCIE Enterprise Lab

CCIE Security Lab

CCNP Service Provider

CCNP Data Center

CCNP Collaboration

CCIE DC Lab

A Layer 2 switching loop is one of the most disruptive failures a network administrator can face. Because Ethernet frames lack a Time-to-Live (TTL) header field, broadcast, multicast, and unknown unicast frames caught in a physical or logical loop circulate endlessly at line rate. Within seconds, a single miswired patch cable or malfunctioning downstream switch can saturate inter-switch trunks, corrupt the Content Addressable Memory (CAM) table, and exhaust the switch’s control-plane CPU.

Quickly isolating a loop on a Cisco Catalyst or Nexus switch requires knowing what telemetry to look for, which CLI commands trace traffic back to the physical port, and how to harden the switch against future topology failures.

Identifying Cisco Switch Loop Symptoms: Logs, LEDs, and CPU Spikes

Before running invasive port isolation, verifying whether performance degradation is actually caused by a Layer 2 bridging loop saves valuable troubleshooting time. The following frequently asked questions break down the primary hardware and software indicators of an active loop.

What does the %SW_MATM-4-MACFLAP_NOTIF syslog message mean?

This warning (often displayed as %FMANFP-4-MACFLAP_NOTIF on newer Catalyst 9000 IOS-XE platforms or %MAC_MOVE-SP-4-NOTIF on modular chassis) indicates that the switch is rapidly learning the exact same source MAC address on two or more different physical interfaces within the same VLAN:

%SW_MATM-4-MACFLAP_NOTIF: Host 0050.56c0.0008 in vlan 10 is flapping between port Gi1/0/1 and port Gi1/0/24

While occasional MAC flaps can occur legitimately due to misconfigured server NIC teaming or wireless roaming, continuous, high-frequency flapping across multiple host MAC addresses is the definitive signature of a bridging loop circulating frames across multiple paths.

What physical LED patterns indicate a switching loop on a Cisco Catalyst switch?

Under normal operating conditions, access and trunk port LEDs blink irregularly in proportion to network traffic. During a broadcast storm caused by a loop, the status LEDs across all ports assigned to the affected VLAN will lock into a rapid, synchronized strobe or appear solid green/amber simultaneously. On switches with a Mode button placed in STAT or UTIL mode, the front-panel LED bar graph will surge toward 100% backplane utilization.

How can I confirm if high CPU utilization is caused by a network loop?

When looped broadcast and multicast packets flood a VLAN, the switch hardware forwards copies of those frames to the supervisor CPU for software processing (such as ARP inspection, DHCP snooping, and Spanning Tree BPDU handling). You can differentiate a loop-induced CPU spike from a routing or management process issue by inspecting three indicators in show processes cpu:
1. High Interrupt Percentage: Look at the header line CPU utilization for five seconds: X%/Y%. In X%/Y%, X represents total CPU usage and Y represents CPU time spent handling hardware network interrupts. If Y is unusually high (for example, 98%/65%), the CPU is being overwhelmed by punted network packets rather than background tasks.
2. Spiking Control-Plane Processes: Look for elevated consumption in ARP Input, IP Input, Spanning Tree, or platform-specific packet-punting processes such as fed punject (IOS-XE) or Hulc LED Process.
3. Control Plane Policing (CoPP) Drops: On IOS-XE switches, running show platform hardware fed switch active qos queue stats internal cpu policer will reveal heavy packet drops on the broadcast and ARP CPU queues.

Key Takeaway: Synchronized port LED strobing combined with high interrupt-driven CPU usage and %SW_MATM-4-MACFLAP_NOTIF syslog alerts confirms an active Layer 2 broadcast storm.


Step-by-Step CLI Guide to Detect and Trace a Network Loop

Once you confirm the symptoms of a switching loop, use the Cisco IOS/IOS-XE CLI to trace the storm from the core or distribution layer down to the exact physical edge port.

Step 1: Verify CPU Load and Isolate Top Processes

Log in via the out-of-band console port if SSH/Telnet sessions are timing out, and verify the control plane status:

Switch# show processes cpu sorted | exclude 0.00
CPU utilization for five seconds: 96%/54%; one minute: 92%; five minutes: 89%
 PID Runtime(ms)     Invoked      uSecs   5Sec   1Min   5Min TTY Process
 142      849210     2910422        291 34.12% 31.05% 28.90%   0 ARP Input
 189      410230     1502110        273 14.50% 13.80% 12.40%   0 Spanning Tree

Step 2: Check the Syslog Buffer for Flapping Ports and VLANs

Query the local logging buffer to identify which VLAN is experiencing instability and which interfaces are disputing MAC ownership:

Switch# show logging | include MACFLAP|SPANTREE

Look at the two ports listed in the MACFLAP_NOTIF entries. If both ports are uplinks/trunks (Po1 and Gi1/0/48), the loop exists further downstream. If one is an uplink and the other is a local access port (Gi1/0/15), the loop is entering through Gi1/0/15.

Step 3: Track Spanning Tree Topology Change Notifications (TCNs)

Rapidly recurring STP topology changes flush the CAM table and worsen flooding. Run the following command to identify which interface is resetting the topology timer and flooding TCNs into the VLAN:

Switch# show spanning-tree vlan 10 detail | include ieee|from|occurred|changes
  VLAN0010 is executing the ieee compatible Spanning Tree protocol
  Number of topology changes 482 last change occurred 00:00:02 ago
          from GigabitEthernet1/0/15

The port listed after from indicates the exact direction from which the topology instability is originating.

Step 4: Inspect Interface Broadcast Counters and Bandwidth Rates

If syslog is suppressed or disabled, locate the offending port by comparing input broadcast/multicast packet counters across all active interfaces:

Switch# show interfaces counters
Port            InOctets    InUcastPkts    InMcastPkts    InBcastPkts
Gi1/0/1          4502190          34102           1204            450
Gi1/0/15     98451204912          12045       45102930      894120411
Gi1/0/48     98910294100         450192       45104100      894125102

In the output above, Gi1/0/15 (an access port) has an astronomical InBcastPkts count matching the uplink Gi1/0/48. You can verify its real-time packet-per-second (pps) ingress rate with:

Switch# show interfaces GigabitEthernet1/0/15 | include line protocol|input rate|broadcasts
  GigabitEthernet1/0/15 is up, line protocol is up (connected)
  5 minute input rate 842105000 bits/sec, 141200 packets/sec
  Received 894120411 broadcasts (0 IP multicasts)

Step 5: Trace Downstream Neighbors and Shut Down the Source Port

Before disabling the interface, check whether it leads to another managed Cisco switch or directly to an endpoint:

Switch# show cdp neighbors GigabitEthernet1/0/15 detail

If CDP returns another managed switch, SSH into that neighbor and repeat Steps 2 through 4 until you reach an edge port with no CDP neighbor. Once you isolate the edge interface, administratively shut it down to break the loop and verify that CPU utilization returns to normal:

Switch# configure terminal
Switch(config)# interface GigabitEthernet1/0/15
Switch(config-if)# shutdown
Switch(config-if)# end

Key Takeaway: Following the trail of MACFLAP_NOTIF logs, STP TCN origins, and InBcastPkts counters from core trunks down to non-CDP edge ports reliably isolates multi-port switching loops.


Troubleshooting Self-Loops Caused by Downstream Unmanaged Switches

While the standard CLI workflow above catches loops spanning two or more Cisco ports, a notorious edge case occurs when a user plugs both ends of a patch cable into a small, unmanaged desktop switch connected to a single Cisco access port.

Because all looped frames bounce inside the unmanaged switch and re-enter the Cisco switch on the exact same physical interface, the Cisco switch will not generate %SW_MATM-4-MACFLAP_NOTIF errors (the MAC address never changes ports on the Cisco switch). Furthermore, many cheap unmanaged switches either strip/drop IEEE 0180.c200.0000 STP BPDUs or fail to process them, allowing a severe broadcast storm to erupt on a single access port before standard STP can intervene.

Follow these steps to isolate a downstream unmanaged switch loop:

Step 1: Identify Access Ports Learning Multiple MAC Addresses

An access port wired to a single workstation or IP phone should only have one or two dynamic MAC addresses. Scan the CAM table on the suspect access port to confirm if a hub or unmanaged switch is attached:

Switch# show mac address-table dynamic interface GigabitEthernet1/0/22
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       ----        -----
  10    001b.214a.9c01    DYNAMIC     Gi1/0/22
  10    0024.e83b.1109    DYNAMIC     Gi1/0/22
  10    dc4a.3e77.8012    DYNAMIC     Gi1/0/22
  10    f01f.af44.029a    DYNAMIC     Gi1/0/22
Total Mac Addresses for this criterion: 4

Step 2: Compare Input vs. Output Broadcast Counters on Access Ports

When a downstream unmanaged switch is self-looped, it amplifies every broadcast sent out by the Cisco switch and reflects it straight back into the same Cisco port. Run show interfaces counters and look for an access port where Input Broadcasts (InBcastPkts) vastly outnumber Output Broadcasts (OutBcastPkts), whereas every other normal access port in that VLAN exhibits high OutBcastPkts (receiving the flooded storm from the switch backplane) and very low InBcastPkts:

Switch# show interfaces GigabitEthernet1/0/22 counters
Port            InOctets    InUcastPkts    InMcastPkts    InBcastPkts
Gi1/0/22     45120941023           4102        8910240      142910455

Port           OutOctets   OutUcastPkts   OutMcastPkts   OutBcastPkts
Gi1/0/22       812049102           3890         120410        1420110

Here, Gi1/0/22 is injecting over 142 million broadcast frames into the Cisco switch—confirming it is the origin of the self-loop.

Step 3: Check for Self-Looped STP Peer States (Shr or BKN*)

If the unmanaged switch passively floods Cisco BPDUs back into the sending Cisco port without stripping them, the Cisco switch will hear its own BPDU on the same interface. Check the Type column in show spanning-tree:

Switch# show spanning-tree interface GigabitEthernet1/0/22
Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0010            Desg BKN*19        128.22   Shr *LOOP_Inc

If an interface transitions from P2p (Point-to-Point) to Shr (Shared) or displays BKN* (Broken), the Cisco port has detected its own reflected BPDUs downstream.

Step 4: Run Cable Diagnostics (TDR) if No Traffic Passes

If the downstream loop completely locks up the unmanaged switch’s ASICs, you can verify whether an active powered device is still attached at the end of the drop using built-in Time Domain Reflectometry:

Switch# test cable-diagnostics tdr interface GigabitEthernet1/0/22
Switch# show cable-diagnostics tdr interface GigabitEthernet1/0/22

A Normal pair termination at a short distance combined with high ingress broadcasts confirms an active rogue switch at the desk location.

Key Takeaway: When a broadcast storm occurs without MAC flapping logs, look for an access port with multiple learned MAC addresses and high InBcastPkts relative to OutBcastPkts to uncover a self-looped unmanaged switch.


Comparing Cisco Loop Prevention Features: BPDU Guard vs. Loop Guard vs. Root Guard vs. UDLD

Reactive troubleshooting stops an active outage, but preventing loops entirely requires selecting the right Cisco Layer 2 protection mechanism for each failure mode. Because Spanning Tree relies on continuous bidirectional BPDU exchange, different hardware or cabling failures require distinct safeguards.

FeaturePrimary Failure Mode AddressedTarget InterfacesTrigger ConditionAction Taken (Port State)Recovery Mechanism
BPDU GuardRogue switches plugged into user wall jacks or self-looped unmanaged switches flooding BPDUs back to the access port.Access ports with PortFast enabled.Receipt of any STP BPDU (superior or inferior) on the protected interface.Places the physical port immediately into err-disabled state (shuts down all traffic).Manual shutdown / no shutdown or automated timer via errdisable recovery cause bpduguard.
Loop GuardSoftware failure on a neighbor switch or unidirectional link failure where a blocking port stops receiving BPDUs and prematurely transitions to Forwarding.Non-designated STP ports (Root, Alternate, and Backup ports) on inter-switch trunks.Sudden absence of incoming BPDUs and expiration of the STP Max Age timer on a blocking port.Places the affected VLAN on the port into loop-inconsistent (blocking) state.Automatic recovery immediately upon receiving a valid BPDU on the interface.
Root GuardRogue or misconfigured switch with a lower bridge priority attempting to hijack the STP Root Bridge role and alter trunk forwarding paths.Designated distribution/core ports facing downstream access or customer switches.Receipt of a superior BPDU claiming a better Root Bridge ID.Places the interface into root-inconsistent (blocking) state for the affected VLAN.Automatic recovery as soon as the port stops receiving superior BPDUs and the message age expires.
UDLD (Aggressive)Physical one-way fiber faults (damaged TX or RX strand) or miswired patch panels where Layer 1 link pulses stay up, blinding STP to a loop.Fiber-optic uplinks and Port-Channel member links.Loss of bidirectional Layer 2 echo acknowledgments from the neighbor for 8 consecutive seconds.Places the physical port into err-disabled state.Manual intervention or automated timer via errdisable recovery cause udld.

Key Takeaway: Use BPDU Guard on edge access ports to block rogue switches, and combine Loop Guard with Aggressive UDLD on inter-switch fiber trunks to protect against unidirectional link failures and missing BPDUs.


Configuration Templates: BPDU Guard, Loop Guard, and Storm Control

To harden your Cisco Catalyst switch against both multi-port bridging loops and unmanaged switch broadcast storms, deploy the following IOS/IOS-XE configuration templates.

1. Global STP Hardening and Auto-Recovery Template

Enable Rapid-PVST+, enforce PortFast and BPDU Guard globally on all access ports by default, and configure errdisable auto-recovery so ports automatically test recovery after 5 minutes (300 seconds):

! Configure Rapid-PVST+ and global PortFast / BPDU Guard defaults
spanning-tree mode rapid-pvst
spanning-tree extend system-id
spanning-tree portfast edge default
spanning-tree portfast edge bpduguard default

! Enable automatic recovery for BPDU Guard, Storm Control, and UDLD events
errdisable recovery cause bpduguard
errdisable recovery cause storm-control
errdisable recovery cause udld
errdisable recovery cause loopback
errdisable recovery interval 300

2. Access Port Loop & Broadcast Storm Protection Template

Apply explicit BPDU Guard and hardware Storm Control to user-facing ports. If an unmanaged downstream switch strips BPDUs and causes a self-loop, Storm Control acts as the failsafe by shutting down (err-disable) the access port as soon as ingress broadcast or multicast traffic exceeds 10% of link capacity:

interface range GigabitEthernet1/0/1 - 44
 description User_Access_Ports
 switchport mode access
 switchport nonegotiate
 ! Explicitly enforce Edge PortFast and BPDU Guard
 spanning-tree portfast edge
 spanning-tree bpduguard enable
 ! Configure Storm Control thresholds (% of total interface bandwidth)
 storm-control broadcast level 10.00 5.00
 storm-control multicast level 10.00 5.00
 storm-control unicast level 80.00 70.00
 ! Shut down (err-disable) the port or trap when threshold is exceeded
 storm-control action shutdown
 storm-control action trap
 exit

3. Uplink / Trunk Port Protection Template

Apply Loop Guard and Aggressive UDLD to fiber uplinks and inter-switch trunks to prevent unidirectional link loops:

interface range TenGigabitEthernet1/1/1 - 4
 description Distribution_Uplink_Trunks
 switchport mode trunk
 ! Protect against missing BPDUs on blocking/alternate paths
 spanning-tree guard loop
 ! Protect against physical one-way fiber faults
 udld port aggressive
 exit

Verification Commands

Verify your active loop protection settings with the following operational commands:

show spanning-tree summary
show errdisable recovery
show storm-control broadcast
show udld neighbors

Key Takeaway: Pairing spanning-tree bpduguard enable with storm-control action shutdown on access ports guarantees automatic port isolation whether a downstream loop forwards BPDUs or strips them.


Cisco Official Documentation and TAC STP Diagnostic Reference

When standard CLI isolation and port hardening do not resolve recurring Spanning Tree instabilities on Cisco Catalyst (IOS-XE) or Cisco Nexus (NX-OS) platforms, consult the official Cisco Technical Assistance Center (TAC) diagnostic architecture and authoritative references below.

Official Cisco Technical Documentation References

  • Troubleshoot STP Problems and Related Design Considerations — Cisco Document ID: 10556
    Defines the canonical Cisco methodology for diagnosing bridging loops, corrupt BPDUs, unidirectional links, and PortFast misconfigurations across Catalyst switches.
  • Understand and Configure Spanning Tree Protocol (STP) Enhancements (Loop Guard, Root Guard, BPDU Guard) — Cisco Document ID: 65884 / 10588
    Details state-machine behavior and hardware ASIC interaction for STP guard enhancements.
  • Cisco Catalyst 9000 Series Switches Layer 2 Configuration Guide (Cisco IOS-XE)
    Provides platform-specific guidelines for Unified Access Data Plane (UADP) ASIC packet punting, hardware MAC learning limits, and Federated Manager (FMAN) MAC flap notification dampening.
  • Cisco Nexus 9000 Series NX-OS Layer 2 Switching Configuration Guide (BA/STP Dispute & MAC Move Loop Detection)
    Covers NX-OS specific loop mitigation mechanisms, including spanning-tree loopguard default and mac address-table loop-detection for VXLAN and classical Ethernet fabrics.

Cisco TAC Escalation Data Collection Specification

Prior to resetting a switch or opening a Severity 1/2 Service Request with Cisco TAC for an unexplained STP failure, capture the following non-disruptive diagnostic output while the symptom is active (or immediately following recovery):

  1. Comprehensive System and STP State:
  2. show tech-support spanning-tree (captures STP state machines, port roles, and internal event histories without outputting full system configuration noise).
  3. show spanning-tree internal event-history tree <vlan-id> (NX-OS) or show platform software fed switch active stp vlan <vlan-id> (Catalyst 9000 IOS-XE) to confirm that the hardware ASIC port forwarding state matches the software control-plane STP state.
  4. Control Plane CPU Packet Capture:
    On Catalyst 9000 Series (IOS-XE), capture in-band packets punted to the CPU to identify the exact frame header looping on the wire:
    ios
    monitor capture TAC_CPU_CAP control-plane in match any buffer size 10
    monitor capture TAC_CPU_CAP start
    ! Wait 5-10 seconds during the loop event
    monitor capture TAC_CPU_CAP stop
    show monitor capture TAC_CPU_CAP buffer brief
  5. Crashinfo and OBFL Logs:
  6. show logging onboard switch active uptime and dir flash:core/ to rule out supervisor switchovers caused by STP process starvation.

Key Takeaway: Verifying hardware ASIC forwarding states against control-plane STP states and capturing in-band CPU punted packets provides the exact evidence needed to resolve complex platform bugs with Cisco TAC.


Conclusion

Checking for a loop in a Cisco switch is fastest when approached methodically. Start by confirming the outbreak through %SW_MATM-4-MACFLAP_NOTIF syslog messages and CPU interrupt statistics, then trace the storm down the topology using STP topology change counters (show spanning-tree detail) and interface broadcast metrics (show interfaces counters). For elusive single-port loops caused by unmanaged desktop switches, compare ingress versus egress broadcast packet counters on access ports learning multiple MAC addresses. Finally, deploying BPDU Guard, Storm Control, Loop Guard, and Aggressive UDLD across your access and trunk layers ensures that future physical wiring mistakes are isolated automatically in milliseconds before they can impact your wider network.

Please follow and like us:
Last modified: November 17, 2026

Author

Comments

Write a Reply or Comment

Your email address will not be published.