Skip to content

Network freezes randomly: switching loop and broadcast storm?

  • Home
  • Blog
  • Network freezes randomly: switching loop and broadcast storm?
Network freezes randomly: switching loop and broadcast storm?
Short answer

When the whole office network freezes for a few minutes and then recovers on its own, the most common cause is a Layer 2 loop: both ends of a cable plugged into a switch, an unmanaged desk switch, or an IP phone’s PC port patched back into the wall. Inside the loop, broadcast frames circulate forever, MAC tables keep changing and the switches grind to a halt. The lasting fix is to keep Spanning Tree enabled (preferably RSTP/MSTP) and to use PortFast together with BPDU Guard, storm control and, where needed, loop protection on user ports.

Symptoms: “%SW_MATM-4-MACFLAP_NOTIF” and every link light blinking

  • The network drops for everyone in the same VLAN at the same time, not just in one building or floor; it recovers after a few minutes and then happens again.
  • Almost every port LED on the switch blinks rapidly and in unison, even outside business hours when there should be little traffic.
  • The Cisco switch log shows lines like: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.5e00.0101 in vlan 4 is flapping between port Gi1/0/11 and port Te1/1/2
  • Connecting to the switch’s web interface or SSH session is very slow or impossible; the management plane is clearly under heavy load.
  • On a switch with BPDU Guard enabled, instead of the network freezing, a single port shuts down and the log shows a line similar to “%SPANTREE-2-RX_PORTFAST:Received BPDU on PortFast enable port. Disabling 2/1”.
  • Users report clients failing to get a DHCP address, dropped VoIP calls and applications disconnecting without any “network cable unplugged” warning.

Root cause: a Layer 2 loop and a broadcast storm

Ethernet frames have no TTL field like IP packets do. When more than one physical path exists between two switches, or on the same switch, broadcast and unknown-destination frames are copied endlessly around those paths. The number of frames multiplies with each round, the links fill up, and this is what is called a broadcast storm. At the same time, the switch learns a device’s MAC address on one port and, milliseconds later, on another. Cisco logs this as MAC flapping and states in its documentation that the most common cause is a Layer 2 loop.

Spanning Tree Protocol (STP) prevents these loops by logically blocking redundant paths. In the field, however, the loop usually does not come from planned redundant links between switches but from the edge: a user in a meeting room plugging a spare cable into another port of the same desk switch, two wall sockets joined by a single unmanaged switch, or an IP phone’s PC output patched back into a wall socket. If PortFast is enabled on these ports without BPDU Guard, the port skips the listening and learning stages and goes straight to forwarding; the loop spreads across the whole VLAN within seconds. If STP is not enabled at all, or the edge device creates the loop in a way STP cannot see, the protection disappears entirely.

Step-by-step fix: finding and breaking the loop

  1. Stop the incident first: while the storm is raging, connecting to the switch via the console is often more reliable than connecting remotely. Also physically note which ports keep blinking.
  2. Read the MAC flapping log. The two ports in the line are the two points where the loop enters this switch. One is usually an uplink and the other a user or access port.
  3. Check on each Layer 2 switch in turn which ports learn the flapping MAC address, and follow the trail towards the edge.
  4. Inspect the Spanning Tree state and topology change counters. A constantly rising topology change count and a constantly changing “from” port point to the direction of the loop.
  5. Shut down the suspect access port and watch whether the storm stops. If it does, inspect the desk switch, IP phone and cables connected to that port on site.
  6. After physically removing the loop, re-enable the port and apply the permanent measures below.

On Cisco IOS and IOS XE, the following read-only commands can be used for diagnosis:

show logging | include MACFLAP
show mac address-table address 0000.5e00.0101
show spanning-tree detail | include ieee|occur|from|is
show running-config interface GigabitEthernet1/0/11
show cdp neighbors GigabitEthernet1/0/11
show spanning-tree summary totals

Shutting down a port with “shutdown” disconnects the users attached to it. During a storm that is an acceptable price, but check the CDP/LLDP neighbour information first so you do not shut down an uplink by mistake.

Permanent prevention: STP, BPDU Guard, storm control and loop protection

Spanning Tree must always be on

Use the same Spanning Tree family on all managed switches in the network. Instead of classic 802.1D, prefer RSTP (IEEE 802.1w), which converges quickly, or MSTP for many VLANs. Deliberately make the core switch the root bridge by setting its priority; otherwise an old switch under a desk may be elected root. On HPE Aruba AOS-CX switches, Spanning Tree and loop protection are disabled by default, so they must be enabled explicitly during installation.

PortFast with BPDU Guard on user ports

PortFast should only be used on ports connected to a single end device. When BPDU Guard is added to these ports, the port is put into the err-disabled state as soon as a BPDU arrives (that is, when a switch or a loop appears behind the port), and the loop is cut before it starts. On Cisco, BPDU Guard is disabled by default. The global command applies BPDU Guard to all ports with PortFast enabled. On Aruba, the equivalent role is played by the admin-edge and BPDU protection settings on edge ports.

conf t
 spanning-tree portfast bpduguard default
 interface range GigabitEthernet1/0/1 - 44
  spanning-tree portfast
 exit
 errdisable recovery cause bpduguard
 errdisable recovery interval 400
end

Automatic recovery is optional; the default recovery interval is 300 seconds and the feature is disabled by default. Even with recovery enabled, the port shuts down again if the loop persists; the real fix is to correct the cabling.

Limiting the damage with storm control

Storm control counts incoming broadcast, multicast or unknown unicast traffic on a port in one-second intervals and drops the excess once the threshold is exceeded; optionally it shuts the port down or sends an SNMP trap. On the Cisco Catalyst 9300 it is disabled by default. The threshold can be given as a percentage of port bandwidth, in bps or in pps, and traffic stays blocked until it falls below the falling threshold.

interface GigabitEthernet1/0/10
 storm-control broadcast level 5.00 3.00
 storm-control action trap
end
show storm-control GigabitEthernet1/0/10 broadcast

Choose thresholds based on your network’s normal broadcast load. Monitor with the “trap” action first and measure normal traffic; move to the “shutdown” action later. A wrong threshold can shut a port down even under normal ARP/DHCP traffic.

Loop protection and physical housekeeping

HPE Aruba describes loop protection as a feature that sends its own loop detection packets out of ports and is useful when spanning tree protocols cannot prevent loops at the edge of the network. In addition, do not keep unused meeting room sockets patched on the patch panel, keep an inventory of unmanaged under-desk switches, and label where the PC port goes in IP phone installations. A large share of the loops we encounter in the field at businesses in Denizli arise from exactly these “let me plug in one more cable” moments.

When should you call an expert?

If the loop keeps recurring every few minutes and you see MAC flapping in the log but cannot find the source, or if your switches come from different vendors with incompatible Spanning Tree versions, the topology needs to be reviewed from scratch. As part of its network solutions, Workas in Denizli provides support with switch configuration, Spanning Tree design, implementing BPDU Guard and storm control policies, and cabling audits; for emergencies we respond with priority during business hours.

Frequently Asked Questions

Why did a user’s port shut down by itself with BPDU Guard enabled?

A device that sends BPDUs was connected to it: a switch, bridging software or a loop. The port goes into the err-disabled state and stays down until it is re-enabled manually or by errdisable recovery.

Should unmanaged desk switches be banned?

Not necessarily, but BPDU Guard and storm control should be applied to the port they connect to. That way a loop on the desk switch affects a single port instead of the whole VLAN.

Does storm control alone fix a loop?

No. Storm control only limits the severity of the storm; the loop physically continues. It should be used together with Spanning Tree and BPDU Guard.

Does MAC flapping always mean a loop?

It is the most common cause, but high-availability pairs sharing the same MAC address or multiple network cards can also produce flapping. Check the ports in the log and the devices connected to them.

Sources

  1. Cisco: Spanning Tree PortFast BPDU Guard Enhancement
  2. Cisco: Troubleshoot MAC Flaps/Loop on Catalyst Switches
  3. Cisco Catalyst 9300: Configuring Optional Spanning-Tree Features (IOS XE 17.9)
  4. Cisco Catalyst 9300: Configuring Port-Based Traffic Control (Storm Control)
  5. HPE Aruba Networking: Configuring Loop Prevention on AOS-CX

Let's Get Started

Let's Work Together!

Let's plan your company's IT needs together — we'll quickly find the right solution for you.

x

Since 2002, Workas Software Technology has provided businesses in Denizli with ERP, cybersecurity, network, server and backup, custom software and AI solutions.

Address
Kınıklı, Hüseyin Yılmaz Cd. No:67,
B Blok Z06, 20160 Pamukkale/Denizli, Türkiye
Get in Touch
0549 669 99 06
0535 089 29 29
Working Hours
Mon - Sat: 8:00 - 18:00