This module addresses the critical importance of Layer 2 security in network infrastructure. As the foundation layer providing access to network users, Layer 2 represents a significant vulnerability point where compromise can affect all upper layers. Students will learn about various Layer 2 attacks including MAC table overflow, VLAN hopping, DHCP spoofing, ARP poisoning, and STP manipulation, along with comprehensive mitigation strategies using Cisco security features.
📋 Overview
🔑 Key Terms
MAC Table Overflow
Attack that floods switch MAC table with fake entries, causing legitimate traffic to be flooded to all ports.
VLAN Hopping
Attack that allows unauthorized access to VLANs by exploiting trunking protocols like DTP.
DHCP Spoofing
Attack using rogue DHCP server to provide false network configuration to legitimate clients.
ARP Poisoning
Attack that corrupts ARP tables by sending gratuitous ARP replies with spoofed information.
Port Security
Cisco feature that limits number of MAC addresses allowed on a switch port.
DHCP Snooping
Security feature that validates DHCP messages and maintains binding database.
🔒 Layer 2 Security Threats
Layer 2 as the Weakest Link
If Layer 2 is compromised, all layers above it are affected. Network administrators routinely protect Layers 3-7 with VPNs, firewalls, and IPS devices, but Layer 2 vulnerabilities can render these protections useless.
Common Layer 2 Attack Types
MAC Table Attacks
Overflow switch MAC tables to cause traffic flooding and enable packet capture.
VLAN Attacks
Bypass VLAN segmentation through hopping and double-tagging techniques.
DHCP Attacks
Disrupt DHCP services through starvation or provide false configuration via spoofing.
ARP Attacks
Poison ARP tables to redirect traffic and enable man-in-the-middle attacks.
MAC Table Attacks
MAC Table Overflow
Attackers flood switches with frames containing random source MAC addresses. When the MAC table fills up, subsequent frames are treated as unknown unicast and flooded to all ports, allowing attackers to capture all network traffic.
Mitigation: Port Security
Switch(config)# interface fa0/1
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 1
VLAN Attacks
VLAN Hopping Attack
DTP Exploitation
Attackers configure hosts to spoof 802.1Q and DTP signaling to establish trunk links with switches, gaining access to all VLANs.
VLAN Double-Tagging Attack
Attackers embed hidden 802.1Q tags inside frames to access unauthorized VLANs.
Mitigation Strategies
- Disable DTP on access ports
- Manually configure trunk ports
- Use native VLAN other than VLAN 1
- Implement VLAN access control lists
DHCP Attacks
DHCP Starvation
DoS attack that exhausts DHCP pool:
- Uses tools like Gobbler
- Creates fake DHCP requests
- Consumes all available IP addresses
- Prevents legitimate clients from obtaining IPs
DHCP Spoofing
Rogue DHCP server provides false information:
- Wrong default gateway (man-in-the-middle)
- Malicious DNS server addresses
- Invalid IP addresses (DoS)
- Intercepts and redirects traffic
DHCP Snooping
DHCP snooping validates DHCP messages, maintains binding database, and prevents both starvation and spoofing attacks by allowing DHCP responses only from trusted ports.
ARP Attacks
ARP Spoofing and Poisoning
Gratuitous ARP Exploitation
Attackers send unsolicited ARP replies with spoofed MAC addresses, causing hosts to update their ARP tables with incorrect information and redirecting traffic to the attacker.
Attack Tools
- dsniff
- Cain & Abel
- ettercap
- Yersinia
Mitigation: Dynamic ARP Inspection (DAI)
DAI validates ARP packets against DHCP snooping binding database and drops invalid ARP responses.
STP Attacks
STP Manipulation Attack
Root Bridge Spoofing
Attackers broadcast BPDUs with lower bridge priority to become root bridge, forcing topology recalculation and capturing traffic from the entire switched domain.
Mitigation: BPDU Guard
BPDU Guard should be implemented on all access ports to prevent unauthorized switches from participating in STP.
Switch(config)# interface fa0/1
Switch(config-if)# spanning-tree bpduguard enable
📚 Case Study: Enterprise Layer 2 Security
Financial Institution Security Hardening
A regional bank implements comprehensive Layer 2 security across 200 switches, including port security, DHCP snooping, DAI, and BPDU Guard. The implementation reduces security incidents by 85% and provides complete visibility into Layer 2 threats through centralized logging and monitoring.
⚠️ Common Pitfalls & Misconceptions
Ignoring Layer 2 Security
Focusing only on Layer 3-7 security while leaving Layer 2 infrastructure vulnerable to attacks.
Layered Security Approach
Implement security at all OSI layers, with particular attention to Layer 2 as the foundation of network security.
✅ Quick Checks
- Why is Layer 2 considered the weakest link in network security?
If Layer 2 is compromised, all layers above it are affected, making upper-layer security measures ineffective. - What is the primary mitigation for MAC table overflow attacks?
Enable port security to limit the number of MAC addresses allowed on each switch port. - How does VLAN hopping work?
Attackers spoof DTP and 802.1Q signaling to establish trunk links with switches, gaining access to all VLANs. - What are the two main types of DHCP attacks?
DHCP starvation (exhausting IP address pool) and DHCP spoofing (rogue server providing false information). - How does BPDU Guard prevent STP attacks?
BPDU Guard disables ports that receive BPDUs, preventing unauthorized switches from participating in STP.
📝 Summary
- Layer 2 security is critical as compromise affects all upper layers
- MAC table attacks flood switches to enable traffic capture
- VLAN attacks bypass segmentation through hopping and double-tagging
- DHCP attacks include starvation and spoofing techniques
- ARP attacks poison tables to redirect traffic
- STP attacks manipulate topology to capture traffic
- Port security, DHCP snooping, DAI, and BPDU Guard provide comprehensive protection
- Layered security approach essential for complete network protection