# MAC address flapping detected: 00:1a:2b:3c:4d:5e between ports Gi0/1 and Gi0/2

- **ID:** `networking/mac-address-flapping-detected`
- **Domain:** networking
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The same MAC address is being learned on two different switch ports, typically due to a network loop, a misconfigured bridge, or a rogue device (e.g., a malicious DHCP server) causing the switch to constantly update its forwarding table.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Cisco IOS 15.2 | active | — | — |
| Juniper JunOS 22.1 | active | — | — |
| Linux bridge 5.10 | active | — | — |

## Workarounds

1. **Enable Spanning Tree Protocol (STP) on the switch to detect and block loops: `spanning-tree vlan 1` (Cisco) or `set protocols rstp` (Juniper).** (90% success)
   ```
   Enable Spanning Tree Protocol (STP) on the switch to detect and block loops: `spanning-tree vlan 1` (Cisco) or `set protocols rstp` (Juniper).
   ```
2. **Identify the rogue device by checking the MAC address OUI and physically tracing the cable; then isolate the port with `shutdown` and reconfigure the network.** (85% success)
   ```
   Identify the rogue device by checking the MAC address OUI and physically tracing the cable; then isolate the port with `shutdown` and reconfigure the network.
   ```
3. **Configure a static MAC address entry on the correct port to prevent flapping: `mac address-table static 00:1a:2b:3c:4d:5e vlan 1 interface Gi0/1`** (75% success)
   ```
   Configure a static MAC address entry on the correct port to prevent flapping: `mac address-table static 00:1a:2b:3c:4d:5e vlan 1 interface Gi0/1`
   ```

## Dead Ends

- **** — This is a temporary fix; the flapping will recur immediately if the underlying loop or misconfiguration is not resolved. (95% fail)
- **** — This ignores the problem; the flapping can cause network instability, packet loss, and even broadcast storms if a loop exists. (80% fail)
- **** — This does not prevent the flapping; it only reduces the frequency of log messages, and can lead to stale entries. (70% fail)
