A MAC Address Is Flapping Between Switch Ports: Do Not Assume a Loop Yet
A log message says MACFLAP, MAC move, or that one MAC address is moving between two ports. It is natural to think “Layer 2 loop” straight away. That may be right, but it is not enough of a diagnosis. The switch has observed one thing: it learned a source MAC on port A, then promptly received a frame with that same source MAC on port B and changed its forwarding-table entry to B. The reason frames arrived on both sides depends on the timing and where those ports lead.
Save the complete log entry, including the MAC, VLAN, both interfaces and timestamp. Cisco's sample messages put those details on one line, and its list of common causes includes wireless roaming, redundant devices using a virtual MAC, and EtherChannel inconsistency as well as Layer 2 loops. Treat this troubleshooting guide as a checklist, not as proof that every alert has the same cause.
Start with the speed of the moves
A phone roaming between two access points can make the upstream network see the MAC at a new access location after seconds or minutes. If service is normal, there are only one or two moves, and the ports genuinely lead to neighbouring APs, that can be ordinary behaviour. It is especially common with locally forwarded wireless traffic. A centrally forwarded SSID may not expose client MAC addresses at the AP access switch at all; this is why an AP can show a client while the switch cannot.
At the other extreme, one address bouncing between two ports several times per second, together with rising broadcast traffic, latency or intermittent outages, puts loops and aggregation faults at the top of the list. That deserves a faster response.
There is also a quieter case: one move during a failover or virtual-machine migration. Two appliances may legitimately share a virtual MAC so that the active peer can take over traffic. A table entry moving when that role changes is expected; both peers forwarding at once is not. Do not dismantle a working redundancy design simply to silence a log message.
Turn a “move” into a traceable path
These are Cisco IOS-style examples. Command names vary, but the investigation is the same:
show logging | include MACFLAP
show mac address-table address aaaa.bbbb.cccc vlan 20
show interfaces status
show cdp neighbors detail
show lldp neighbors detail
show spanning-tree vlan 20
show etherchannel summary
My usual order is:
- Preserve the context. Take the VLAN and both ports from the log, not just the MAC. The same address can be learned in separate VLANs, and omitting the VLAN often produces an unrelated result.
- Label where both ports go. Check descriptions, CDP/LLDP neighbours and cabling records. If both ports eventually reach one small downstream switch, the search area collapses. If one is a port-channel and the other is a member link, investigate aggregation first.
- Trace the table in both directions. Query the same MAC and VLAN on adjacent switches, writing down the point at which it is stable. Do not start shutting ports at random from the core; first find where the two paths actually meet.
- Check STP and the physical interface at the same time. Confirm the root bridge, port roles, blocked states and recent topology changes for this VLAN. An interface bouncing up and down can make a MAC table look unstable too, and it is easy to miss a physical problem when looking only at MAC logs.
The point is not to name a “bad port” immediately. It is to turn two abstract interface names into a real path. Once the path is clear, the next action has a basis.
Common patterns and where to look first
Fast moves between two ordinary access ports. Check for a small unmanaged switch, a temporary patch cable, a dual-homed device or a desktop AP joining two wall outlets. Do not assume every access port has just one PC behind it. If the impact is spreading, isolate the suspicious branch under your change process and preserve logs and counters. Dropping a core uplink on instinct can turn a troubleshooting window into an outage.
Moves between two physical links that should be aggregated. Compare both ends: aggregation mode, member links, trunk or access state, allowed VLANs, native VLAN and speed negotiation. A familiar failure is one side treating two links as an LACP port-channel while the other forwards over them as two independent links. Neither end is necessarily doing anything mysterious; each is following its local configuration, and the same frame then arrives through two entrances.
Occasional moves involving a wireless AP port. Check whether the MAC belongs to a recently roaming client before changing STP. Compare controller association time, AP name and SSID forwarding mode. A client returning from sleep can also appear to change position briefly. If you need to identify addresses in the wireless frames themselves, see which MAC address is which in a Wi-Fi capture.
Moves between gateway, load-balancer or firewall interfaces. Review the HA state and recent failovers. Virtual IP and MAC designs expect the active node to take traffic. The real question is whether there is a split-brain condition, a failed heartbeat, or an old appliance still connected to the service VLAN.
A vendor prefix that does not look like anything onsite. The prefix can narrow the search but cannot prove device identity. Virtual adapters, USB Ethernet adapters and locally administered addresses all make the prefix less intuitive. Look it up on the MAC vendor lookup page, then confirm the finding with interfaces, neighbours and asset records.
When to treat it as an incident now
Do not leave it as a routine log entry if any of these appear together: one MAC moving rapidly and repeatedly; several unrelated MACs moving across the same pair of ports; rising CPU, broadcast or unknown-unicast traffic, or packet loss; frequent STP topology changes; or reports of a broad slowdown. None proves a loop in isolation, but together they show that the forwarding plane is unstable.
An isolated move is still worth retaining. Compare it with AP roaming, planned changes and failover timestamps before closing the alert. That record gives you a baseline when the next event is real.
The useful question is not simply whether the MAC table changed. It is whether the change matches the network's design. Confirm the VLAN, ports and cadence first, then trace the path. That catches loops without turning one normal roam into an unnecessary incident.
References
- Cisco, “Troubleshoot MAC Address Flap Notification Error” — MAC-flap definition plus wireless, redundant-MAC and EtherChannel cases: https://www.cisco.com/c/en/us/support/docs/ip/syslog/221140-troubleshoot-mac-address-flap-notificati.html
- Cisco, “Troubleshoot MAC Flaps/Loop on Cisco Catalyst Switches” — a troubleshooting path for MAC flaps, STP and physical loops: https://www.cisco.com/c/en/us/support/docs/lan-switching/spanning-tree-protocol-stp-8021d/221722-troubleshoot-mac-flaps-loop-on-cisco-cat.html