# Networking: %SW_MATM-4-MACFLAP_NOTIF: Host is flapping between ports / broadcast storm

**Code:** `MAC flapping / broadcast storm (spanning tree loop)` · **Category:** Networking · **Seen on:** Cisco, Networking

A layer-2 loop is making frames circle the network, saturating links and making the whole VLAN crawl.

## Meaning

Someone plugged a switch or cable back into the same network, or spanning tree is off or misconfigured. Find the flapping MAC, unplug the loop, and enable STP protections: BPDU guard on edge ports, root guard, storm control and loop guard.

## Common causes

- Cable plugged into two ports of the same network
- Spanning tree disabled or inconsistent
- Unmanaged switch added by a user
- Missing BPDU guard on access ports
- Faulty switch or NIC flooding

## Quick fix

1. Find it: `show mac address-table | include <mac>`
2. Unplug the offending cable and enable BPDU guard + storm control
3. Verify the root bridge with `show spanning-tree`

## Detailed fix by platform

### Cisco

1. 

```
show spanning-tree summary
show interfaces | include broadcasts
show logging | include MACFLAP
```


## How to diagnose

1. **Log** — MAC flapping?
2. **STP** — Enabled, correct root?
3. **Edge ports** — BPDU guard?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/networking/stp-loop-broadcast-storm-mac-flapping)
