Port Security and MAC Filtering
What you'll learn: How to configure network switches to allow only specific, authorized devices onto your network by controlling MAC addresses at the port level.
The Core Concept
Imagine a nightclub with a strict guest list at the door. Even if someone gets past the front gate, the bouncer at each entrance checks IDs and only lets in people on the list—and kicks out anyone trying to sneak in with a fake ID.
Port security works the same way for network switches. Instead of letting any device plug into any network port, you configure each switch port to accept traffic only from approved MAC addresses. If an unauthorized device connects—or someone tries MAC address spoofing—the port can automatically shut down, send alerts, or restrict the intruder.
Why This Matters
You've learned about MAC address spoofing and MAC flooding attacks. Port security is your primary defense against these threats on a switched network.
Key Features:
- MAC address limiting: Restrict how many MAC addresses can connect to a single port (usually 1-3)
- Static MAC binding: Manually specify which exact MAC addresses are allowed
- Dynamic learning: Let the switch learn the first MAC(s) it sees and lock to those
- Violation actions: Configure what happens when unauthorized MACs appear:
- Protect: Drop frames silently
- Restrict: Drop frames and log violations
- Shutdown: Disable the port entirely (most secure)
Practical Application
Port security prevents attackers from plugging rogue devices into your network, stops MAC flooding by limiting learned addresses per port, and makes MAC spoofing attacks immediately detectable—the switch will see two different devices claiming the same MAC.
Key Takeaway: Port security transforms your switch ports into checkpoints that verify device identity by MAC address, automatically blocking unauthorized connections and spoofing attempts before they can intercept traffic.