Yes—modern managed switches are protected from MAC flooding, but not by the forwarding hardware itself; protection comes from a configurable control-plane feature called port security (or an equivalent MAC-limit mechanism), and an unmanaged or unconfigured switch remains vulnerable.

The question as phrased ("are switches protected from MAC flooding in any...") is truncated, so the exact scope is unknown. What can be answered precisely is the mechanism: Ethernet switches learn source MAC addresses into a content-addressable memory (CAM) table, and MAC flooding exploits that learning process by filling the table with bogus source addresses, at which point the switch falls back to flooding unknown-destination traffic out every port—defeating the privacy a switched network is supposed to provide. Whether a given switch resists this depends on model class and configuration, not on the fact that it is "a switch."

What MAC Flooding Actually Does

A switch builds its forwarding table by recording the source MAC address of every frame it receives and the port it arrived on. When a frame later arrives destined for a known address, the switch sends it only out the recorded port. When the destination is unknown, the switch floods the frame out all ports in the same VLAN—the standard, correct behavior for unknown unicast.

MAC flooding abuses the second half of that behavior. An attacker sends a large volume of frames with random, never-seen source addresses. Each one creates a table entry. CAM memory is finite—historically tens of thousands of entries on access switches. Once the table is full, the switch cannot learn new legitimate addresses and must treat their traffic as unknown, flooding it. A host on another port running packet capture can then observe traffic it was never meant to see.

Two points of nuance matter here. First, MAC flooding is a confidentiality attack in the first instance; it does not by itself give the attacker control of the network. Second, the attack is bounded by VLAN boundaries: flooding occurs within a VLAN, not across routed boundaries or isolated VLANs, so segmentation limits the blast radius.

Where the Protection Lives

The switch's silicon does not "know" it is being attacked. Protection is a policy layer:

Port security / MAC limiting. Administrators cap the number of distinct source MAC addresses a port may learn (often one per access port). When the limit is exceeded, the switch takes a configured action: drop offending frames, restrict (drop frames from new addresses while permitting known ones), or shut the port down. This is the primary defense. Dynamic MAC learning limits and aging tuning. Some platforms allow global caps on table size or aggressive aging so stale entries expire quickly, reducing the window of table exhaustion. Sticky MAC and static binding. Pinning expected addresses to each port prevents an attacker's random addresses from being learned at all. DHCP snooping and dynamic ARP inspection. These do not stop table exhaustion directly, but they constrain the related attacks (rogue DHCP, ARP spoofing) that flooding is often used to enable. VLAN segmentation and private VLANs. These limit what a flooded frame can reach, so even a successful flood yields less. Port isolation and storm control. Storm control can rate-limit broadcast and unknown-unicast floods, blunting the volume, though it is not a substitute for port security.

On the question of "any" switch: unmanaged and many inexpensive "smart" switches have no port-security feature and no way to enforce a MAC limit. A managed switch with port security available but not enabled is equally unprotected in practice. The honest answer is therefore conditional: protection exists as a feature on managed equipment and must be turned on.

The Fallback Behavior Is the Vulnerability

It is worth being precise about why this is not a firmware bug. Unknown-unicast flooding is a designed behavior: without it, a switch could not deliver the first frame to a host whose address it has not yet learned. The same mechanism lets a newly connected device receive traffic before the table catches up. MAC flooding simply weaponizes a correct default. This is why defenses are policy-based rather than architectural—there is no "secure" forwarding mode that eliminates the tradeoff without also eliminating legitimate learning.

A useful counterexample: a switch with port security set to one MAC per access port will reject the attacker's random addresses at the first extra source MAC, so the CAM table never fills. The flood traffic is dropped at ingress; the table is never exhausted; legitimate unknown unicast continues to flood normally but briefly. The defense acts before the failure mode, not after it.

Limits, Exceptions, and Common Confusion

Trunk and uplink ports carry many legitimate MAC addresses, so a one-MAC limit would break them. Administrators set higher limits there—which means trunk ports remain a softer target unless the limit is tuned and monitored. Wireless and virtual environments have their own learning behavior; a wireless controller or hypervisor virtual switch may not expose the same port-security knobs, and MAC flooding's relevance shifts. The attacker must be on the network. MAC flooding is a Layer 2 attack requiring a physical or logical port. It does not work remotely across a routed boundary. Detection, not just prevention. Even with limits in place, monitoring CAM table churn and port-security violation counters is how operators notice an attempt. Management-plane impact. In severe cases, table exhaustion and the resulting flooding can degrade performance and, on some platforms, affect the CPU that handles control traffic. That is a secondary effect, not the attack's goal.

The frequent confusion is treating "switch" as a security guarantee. A switch is a learning bridge; its isolation properties depend entirely on correct, bounded learning. The moment learning is unbounded and the table can be exhausted, the device behaves like a hub for unknown-destination traffic—which is exactly what the attacker wants.

Practical Bottom Line

Protection is available and effective on managed switches through port security or MAC limiting, combined with VLAN segmentation and monitoring. It is absent by default on unmanaged hardware and inactive by default on managed hardware until configured. The question's truncation ("in any...") leaves the specific model, vendor, and configuration unknown, and those details determine the actual answer for any particular deployment.