Q: In a corporate network, an attacker executes a malicious script that generates millions of random fake MAC addresses and rapidly fills up the network switch's CAM table (MAC address table). What happens to the switch, and what security risk does this open?
This is a MAC Flooding attack.
Want to master this scenario in a live sandbox? KodeKloud's Istio Service Mesh & Advanced Kubernetes Networking Course covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "In our multi-VPC setup, services in private subnets ran into this exact routing obstacle. The interviewer is testing: MAC Flooding, fail-open behavior of switches.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."
Production Solution & Architecture
This is a MAC Flooding attack. A switch has a limited amount of memory to map MAC addresses to physical ports. When the attacker's script completely exhausts this memory, the switch can no longer remember where legitimate devices are plugged in. When a switch doesn't know where to send a packet, its default fail-safe protocol is to "fail-open" and act like a Hub. It broadcasts every single incoming packet out of *every single port* on the switch. The security risk is catastrophic: the attacker can now run a packet sniffer (like Wireshark) on their laptop and passively see all horizontal traffic intended for other computers, intercepting plaintext passwords and sessions. (Mitigated by configuring Switch Port Security algorithms limiting MACs per physical port).
- Immediate Triage: This is a MAC Flooding attack.
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Treating stateless Network ACLs as stateful firewalls without specifying outbound ephemeral return ports when configuring Networking corporate network Security Groups track connection state automatically, whereas stateless Network ACLs require explicit ephemeral port rules (1024-65535) for return traffic.
- Opening short-lived non-pooled TCP client connections, exhausting ephemeral ports in TIME_WAIT state when configuring Networking corporate network Rapidly opening and closing short-lived TCP sockets without connection pooling exhausts ephemeral ports, causing connection refusal errors.
- Directing load balancer health checks to heavy computational endpoints rather than dedicated health routes when configuring Networking corporate network Deep health check paths amplify database load during traffic spikes and risk cascading eviction of healthy application nodes.
- Triggering BGP route dampening by rapidly announcing and withdrawing multihomed network prefixes when configuring Networking corporate network Rapidly flapping BGP route announcements triggers upstream ISP route dampening, effectively blackholing network traffic for hours.