Network instability on a Cisco switch often manifests in one of two ways: physical port (link) flapping, where an interface repeatedly cycles between up and down states, or Layer 2 MAC address flapping, where the switch continuously relearns the same hardware address across different ports. Both conditions degrade application performance, trigger Spanning Tree Protocol (STP) topology recalculations, and can eventually force interfaces into an administrative shutdown. Diagnosing flapping quickly requires isolating whether the fault lies at Layer 1 (physical media and transceivers) or Layer 2 (forwarding loops and host roaming), and then applying the appropriate Cisco IOS, IOS-XE, or NX-OS verification commands.
Table of Contents
Step-by-Step CLI Guide to Check Physical Port Flapping History and Logs
To identify which physical interfaces are cycling up and down, inspect the switch’s system message buffer, interface reset counters, and hardware link-state history across Cisco Catalyst (IOS/IOS-XE) and Cisco Nexus (NX-OS) platforms.
Step 1: Inspect the Local Syslog Buffer for Link State Changes
Whenever a physical interface transitions between states, the operating system generates %LINK-3-UPDOWN (physical layer) and %LINEPROTO-5-UPDOWN (data link layer) messages. Filter the log buffer to spot repeating timestamps on the same port:
! Cisco IOS / IOS-XE: View all link up/down events
Switch# show logging | include UPDOWN
! Filter logs for a specific suspect interface
Switch# show logging | include GigabitEthernet1/0/10
Typical output confirming a physical port flap looks like this:
Oct 05 14:12:01.114: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/10, changed state to down
Oct 05 14:12:03.418: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/10, changed state to up
Oct 05 14:12:04.419: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/10, changed state to up
On Cisco NX-OS, filter the logfile for ETHPORT-5-IF_DOWN and ETHPORT-5-IF_UP events:
Nexus# show logging logfile | include ETHPORT-5-IF
Step 2: Check Interface Reset Counters and Last Flap Timestamps
Even if the circular syslog buffer has rolled over, individual interface counters preserve historical evidence of instability. Inspect the interface resets counter and physical layer error statistics:
! Cisco IOS / IOS-XE: Check resets, input errors, and CRC counters
Switch# show interfaces GigabitEthernet1/0/10 | include line protocol|resets|CRC|input errors
Look for a rising interface resets count paired with CRC, frame, or input errors, which point to damaged cabling or failing optics.
On Cisco NX-OS, the show interface output includes an explicit Last link flapped timer alongside the reset counter:
Nexus# show interface Ethernet1/1 | include "is |flapped|resets"
Ethernet1/1 is up
Last link flapped 00:04:12
14 interface resets
Step 3: Check Port Up/Down History with show interface link
On supported Cisco Catalyst switches (such as Catalyst 4500, 6500, and 9000 Series), examine the time-since-last-change and link activity summary across all ports to spot interfaces that recently bounced:
Switch# show interfaces link
Port Name Down Time Up Time
Gi1/0/1 Uplink-Core 00:00:00 45d12h
Gi1/0/10 AP-Floor2 00:01:14 00:00:22
Step 4: Verify If the Port Was Shut Down Into an err-disabled State
If a port flaps rapidly beyond the switch’s threshold, Cisco’s Link Flap Prevention mechanism disables the port automatically. Check whether any interfaces are currently suspended:
Switch# show interfaces status err-disabled
Port Name Status Reason Err-disabled Vlans
Gi1/0/10 AP-Floor2 err-disabled link-flap
Takeaway: Correlating show logging timestamps with interface resets and show interfaces status err-disabled immediately isolates whether a port is actively flapping or has already been shut down by the switch.
Understanding the Causes of Port Flapping and the link-flap Errdisable State
Once CLI diagnostics confirm that a physical interface is cycling up and down, identifying the underlying Layer 1 or protocol fault prevents the issue from recurring. The most common questions regarding root causes and Cisco’s automated shutdown behavior are addressed below.
Why is my Cisco switch interface going up and down repeatedly?
Physical port flapping occurs when the switch’s PHY chip repeatedly loses and regains carrier signal or link synchronization with the connected device. The primary causes include:
* Damaged or Substandard Ethernet Cabling: Broken twisted pairs, loose RJ45 crimps, oxidized patch panel punch-downs, or copper runs exceeding 100 meters cause intermittent loss of electrical continuity.
* Faulty or Incompatible SFP/SFP+ Transceivers: Degraded laser diodes, dirty fiber end-faces, mismatched wavelengths (e.g., 850nm multimode vs. 1310nm single-mode), or uncertified third-party optics cause optical receive power to hover right at the loss-of-signal (LOS) threshold.
* Speed, Duplex, and Auto-Negotiation Mismatches: Hardcoding speed and duplex on one end while leaving the link partner set to auto frequently causes link negotiation failures, late collisions, and repeated link resets.
* Power over Ethernet (PoE) Overload or Brownouts: If a powered device (such as a pan-tilt-zoom camera or Wi-Fi 6E/7 access point) draws more wattage than the port allows—or has a short in the cable—the switch cuts inline power, causing the endpoint to reboot in an endless loop.
* Energy Efficient Ethernet (EEE / 802.3az) Incompatibilities: Low-power idle states between certain switch ASICs and endpoint NIC drivers can fail to wake properly, dropping and re-establishing the link.
Why does a Cisco switch put a flapping port into an err-disabled state?
Every time an interface changes state, the switch CPU must process interrupts, update hardware forwarding tables, generate syslog/SNMP notifications, and potentially trigger Spanning Tree Protocol (STP) Topology Change Notifications (TCNs) or routing protocol reconvergence. To protect the control plane from high CPU utilization and stabilize the network topology, Cisco switches enable Link Flap Detection by default. When an interface exceeds the allowed number of up/down cycles within a short measurement window, the switch places the port into an err-disabled state with the reason link-flap, logging %PM-4-ERR_DISABLE: link-flap error detected on [interface], putting [interface] in err-disable state.
How do I check the current link-flap threshold values on my switch?
Default thresholds vary slightly by platform and IOS release (commonly 5 flaps within 10 seconds on Catalyst switches, or up to 20 flaps within 10 seconds on certain routing platforms). Check your device’s exact thresholds and detection status with these EXEC commands:
! View flap counts and time windows that trigger errdisable
Switch# show errdisable flap-values
ErrDisable Reason Flaps Time (sec)
----------------- ------ ----------
pagp-flap 3 30
dtp-flap 3 30
link-flap 5 10
! Confirm link-flap detection is enabled
Switch# show errdisable detect | include link-flap
Takeaway: The link-flap err-disabled state is a protective control-plane mechanism triggered almost exclusively by Layer 1 hardware faults, PoE brownouts, or negotiation mismatches.
Configuration Templates: Link-Flap Thresholds, Auto-Recovery, and Interface Dampening
After resolving or mitigating physical instability, you can use the following Cisco IOS / IOS-XE configuration templates to manually recover suspended ports, automate errdisable recovery, customize link-flap sensitivity, or apply IP event dampening on Layer 3 routed interfaces.
1. Enable Automatic Errdisable Recovery for Link-Flap Events
By default, an err-disabled port stays down until an administrator intervenes. Use this template to automatically re-enable ports shut down by link-flap after a defined cooldown timer:
configure terminal
! Ensure link-flap detection is active
errdisable detect cause link-flap
!
! Enable auto-recovery specifically for link-flap shutdowns
errdisable recovery cause link-flap
!
! Set recovery timer in seconds (Range: 30 to 86400; Default: 300)
errdisable recovery interval 300
end
! Verify auto-recovery configuration and check countdown timers for active ports
show errdisable recovery
2. Customize Link-Flap Error Thresholds
In environments where brief link bounces are expected during endpoint boot cycles, adjust how many flaps must occur within a given window before the switch disables the port:
configure terminal
! Syntax: errdisable flap-setting cause link-flap max-flaps <1-100> time <1-120>
errdisable flap-setting cause link-flap max-flaps 10 time 15
end
! Verify updated threshold values
show errdisable flap-values
3. Manually Reset an Err-Disabled Interface (Plus EEE Mitigation)
If auto-recovery is not enabled, bounce the interface administratively after replacing the faulty cable or transceiver. If Energy Efficient Ethernet (EEE) negotiation is causing the flap, disable EEE on the port simultaneously:
configure terminal
interface GigabitEthernet1/0/10
! Optional: Disable 802.3az Green Ethernet / EEE if NIC negotiation flaps
no power efficient-ethernet auto
! Reset the err-disabled state
shutdown
no shutdown
end
4. Configure Interface Event Dampening (Routed / Layer 3 Ports)
On Layer 3 switch interfaces or routed uplinks where a flapping link repeatedly triggers OSPF, EIGRP, or BGP route recalculations, enable IP Event Dampening. Each flap assigns a penalty (default 1000); once the penalty exceeds the suppress threshold, the switch suppresses routing updates for that interface until the penalty decays below the reuse threshold:
configure terminal
interface GigabitEthernet1/0/48
no switchport
! Enable dampening with default parameters:
! Half-life: 5 sec | Reuse: 1000 | Suppress: 2000 | Max-suppress: 20 sec
dampening
!
! Or specify custom parameters:
! dampening <half-life 1-30> <reuse 1-20000> <suppress 1-20000> <max-suppress 1-255>
dampening 10 1000 2000 40
end
! Verify dampening status and suppressed interfaces
show interface dampening
show dampening interface
Takeaway: Use errdisable recovery cause link-flap on Layer 2 access ports for hands-off recovery, and reserve dampening for Layer 3 routed uplinks to shield dynamic routing protocols from instability.
How to Check and Troubleshoot Layer 2 MAC Address Flapping
Not all flapping on a Cisco switch involves a physical port going down. MAC address flapping occurs when the physical links remain solidly up, but the switch’s Content Addressable Memory (CAM) table repeatedly learns the exact same source MAC address on two or more different interfaces within the same VLAN.
Step 1: Identify the Flapping MAC Address, VLAN, and Ports in Syslog
When MAC flapping occurs, Cisco Catalyst switches generate %SW_MATM-4-MACFLAP_NOTIF alerts (while Cisco Nexus switches log %L2FM-4-L2FM_MAC_FLAP_MOVE). Check the logs to extract three critical pieces of data: the Host MAC address, the VLAN ID, and the two competing ports:
Switch# show logging | include MACFLAP_NOTIF
Apr 26 12:27:55: %SW_MATM-4-MACFLAP_NOTIF: Host 0011.2233.4455 in vlan 10 is flapping between port Gi1/0/10 and port Po1
You can also enable and inspect detailed MAC move counters directly in the MAC address table notification history:
Switch# show mac address-table notification change
Step 2: Check Current MAC Table Learning and Trace Neighboring Devices
Query the MAC address table for the offending host address and identify what is connected to the two ports reported in the log:
! Check which port currently holds the MAC entry
Switch# show mac address-table address 0011.2233.4455
! Identify the OUI/vendor or check ARP cache on a Layer 3 switch to find the IP
Switch# show ip arp | include 0011.2233.4455
! Check CDP and LLDP to see if the flapping ports lead to downstream switches or APs
Switch# show cdp neighbors Gi1/0/10 detail
Switch# show lldp neighbors Po1 detail
Step 3: Distinguish Benign Host Movement from Dangerous Layer 2 Loops
Before shutting down ports, determine which of the four common scenarios is causing the MAC flap:
1. Wireless Client Roaming (Benign): If the MAC address belongs to a Wi-Fi client and the two ports connect to wireless Access Points (in local/flex-connect bridged mode), the flap simply reflects a user roaming between APs. Optimizing AP transmit power or cell overlap reduces excessive roaming flaps.
2. Server NIC Teaming / Virtual Switch Misconfiguration (Moderate Impact): If both ports connect to the same ESXi host, Hyper-V server, or Linux bond configured for active-active load balancing (such as “Route based on IP hash”) without a corresponding Port-Channel/LACP configuration on the Cisco switch, frames from the same VM MAC will arrive on different physical ports.
3. EtherChannel / DTP Mismatch (Moderate Impact): Inconsistent trunking or channel-group modes (e.g., mode on on one side and LACP active on the other, or rogue DTP frame forwarding across unmanaged devices) causes traffic to loop back over parallel links. Verify bundle consistency with show etherchannel summary.
4. Bridging / Layer 2 Forwarding Loop (High Impact): An unmanaged desktop switch plugged into two wall jacks, a cabling loop, or a Spanning Tree failure causes broadcast and unicast frames to circulate endlessly, making every MAC address appear to flap between the looped ports.
Step 4: Pinpoint and Break a Layer 2 Loop Using Input Packet Rates and STP Counters
If you suspect a Layer 2 loop, check interface input packet rates and Spanning Tree Topology Change Notification (TCN) counters:
! Look for interfaces with abnormally high 6- to 8-digit packet/sec input rates
Switch# show interfaces | include is up|input rate
! Check which port is generating constant Spanning Tree topology changes
Switch# show spanning-tree vlan 10 detail | include ieee|occurr|from
Follow the port with the highest input packet rate to the downstream switch using CDP/LLDP until you locate the edge port where the physical loop originates, then administratively shut down the offending interface.
Takeaway: Always check show cdp/lldp neighbors and input rate counters when troubleshooting %SW_MATM-4-MACFLAP_NOTIF to quickly separate harmless wireless roaming from catastrophic Layer 2 broadcast storms.
Best Network Monitoring Tools to Detect Cisco Switch Flapping Proactively
Rather than waiting for users to report dropped connections and running manual CLI commands, network administrators rely on SNMP trap receivers and Syslog analyzers to detect physical port flaps and MAC table instability in real time.
- Cisco Catalyst Center (formerly Cisco DNA Center)
- How it detects flapping: Uses streaming telemetry, SNMP, and Syslog correlation alongside AI-driven network analytics to automatically flag flapping interfaces, PoE faults, SFP optical degradation, and Layer 2 MAC move anomalies across Catalyst 9000 architectures.
Best for: Medium-to-large enterprise Cisco networks seeking automated root-cause analysis and guided remediation workflows.
SolarWinds Network Performance Monitor (NPM)
- How it detects flapping: Polls Cisco interface MIBs (
IF-MIB), listens forlinkUp/linkDownSNMP traps, and ingests%LINK-3-UPDOWNand%SW_MATM-4-MACFLAP_NOTIFsyslogs. Administrators can configure custom alerting rules that trigger only when a port transitions more than $X$ times within $Y$ minutes. Best for: Multi-vendor enterprise NOCs requiring granular flap-rate thresholds and historical interface availability heatmaps.
PRTG Network Monitor (Paessler)
- How it detects flapping: Combines SNMP Traffic, SNMP Trap Receiver, and Syslog Receiver sensors to monitor port state changes (
ifOperStatus) anderr-disabledstates. Its built-in state-change counters immediately highlight ports with abnormal reset frequencies. Best for: Mid-sized IT teams looking for rapid sensor-based deployment and customizable dashboard alerts.
ManageEngine OpManager
- How it detects flapping: Processes Cisco SNMP traps (including
cieLinkDown,cieLinkUp, andcmnMacChangedNotification) and correlates Syslog events into tiered alarms, with automated workflow actions that can execute CLI scripts to inspect or shut down a misbehaving port. Best for: Organizations wanting integrated switch port mapping (Switch Port Mapper) to instantly see which endpoint MAC or IP is attached to a flapping interface.
LibreNMS + Graylog / ELK Stack (Open-Source Stack)
- How it detects flapping: LibreNMS tracks interface state transitions and DOM optical transceiver power levels over SNMP, while Graylog or Elasticsearch/Logstash/Kibana (ELK) ingests centralized Cisco syslogs to trigger webhook alerts (Slack, PagerDuty, Teams) whenever
MACFLAP_NOTIForERR_DISABLEstrings surge in frequency. - Best for: Engineering teams that prefer cost-effective, open-source observability with high-speed log aggregation across hundreds of Catalyst and Nexus switches.
Takeaway: Pairing SNMP state polling with real-time Syslog pattern matching (UPDOWN, ERR_DISABLE, and MACFLAP_NOTIF) provides immediate visibility into transient flaps before they escalate into network-wide outages.
Official Cisco Documentation and Platform Diagnostic References
This reference section outlines the official Cisco support documentation titles, platform architectures, and hardware-level diagnostic commands used to validate physical media and transceiver health on Cisco Catalyst and Cisco Nexus switches.
Official Cisco Support Guides and Command References
- Troubleshoot Port Flaps on Catalyst 9000 Series Switches (Cisco Document ID: 218219): Official engineering workflow covering syslog verification, copper Time-Domain Reflectometry (TDR), Digital Optical Monitoring (DOM), and Forward Error Correction (FEC) validation on Cisco IOS-XE platforms.
- Troubleshoot MAC Address Flap Notification Errors (Cisco Support Article): Official diagnostic procedure for
%SW_MATM-4-MACFLAP_NOTIF, detailing Layer 2 loop isolation via input packet rates, Spanning Tree TCN analysis, and EtherChannel consistency verification. - Errdisable Port State Recovery on the Cisco IOS Platforms (Cisco Document ID: 69980): Authoritative reference defining all
errdisabletriggers (link-flap,pagp-flap,dtp-flap,udld,bpduguard), default flap thresholds, and global recovery intervals. - Cisco Nexus 9000 Series NX-OS Interfaces Configuration Guide & Show Command Reference: Documents NX-OS link-state tracking,
ethpm(Ethernet Port Manager) internal event histories, and interface reset counters.
Platform-Specific Hardware Diagnostic Commands
| Diagnostic Function | Platform / OS | Exact CLI Command Syntax | Operational Purpose |
|---|---|---|---|
| Copper Cable TDR Test | Catalyst (IOS / IOS-XE) | test cable-diagnostics tdr interface Gi1/0/10show cable-diagnostics tdr interface Gi1/0/10 | Sends a pulse down RJ45 copper pairs to detect open circuits, short circuits, impedance mismatches, and distance-to-fault. |
| Optical Transceiver DOM | Catalyst (IOS / IOS-XE) | show interfaces transceiver detail | Displays real-time SFP/SFP+ laser temperature, voltage, Tx bias current, and Tx/Rx optical power (dBm) against warning/alarm thresholds. |
| Optical Transceiver DOM | Nexus (NX-OS) | show interface Eth1/1 transceiver details | Verifies optical receive power and flags Loss of Signal (LOS) or degraded fiber paths on Nexus ports. |
| Internal Port State History | Nexus (NX-OS) | show system internal ethpm event-history interface Eth1/1 | Dumps the low-level NX-OS Ethernet Port Manager state machine log to trace sub-second link transitions and transceiver state changes. |
| Hardware Controller Counters | Catalyst (IOS-XE) | show interfaces Gi1/0/10 controller | Reads raw ASIC/MAC-level transmit and receive error counters directly from switch hardware. |
Takeaway: Utilizing built-in hardware diagnostics like test cable-diagnostics tdr for copper runs and show interfaces transceiver detail for fiber links eliminates guesswork when proving whether a flapping port is caused by defective physical cabling or failing optics.
Conclusion
Checking and resolving flapping on a Cisco switch starts with distinguishing between Layer 1 physical link instability and Layer 2 MAC address movement. By inspecting show logging and show interfaces counters first, verifying whether link-flap protection has placed ports into an err-disabled state, and validating physical media with TDR or DOM diagnostics, you can quickly stabilize bouncing physical ports and tune auto-recovery timers. When physical links are stable but %SW_MATM-4-MACFLAP_NOTIF messages appear, tracing neighbor connections and interface input rates allows you to isolate Layer 2 loops or misconfigured host bonds before they disrupt the wider network.











Comments