Use it when hardening access ports, or when a legitimate host is blocked, err-disabled or gets no address.
Layer 2 Security
Layer 2 security features protect the access layer: port security limits MAC addresses per port, DHCP snooping blocks rogue DHCP servers and builds a binding table, Dynamic ARP Inspection and IP Source Guard use that table to stop spoofing, and BPDU guard stops rogue switches.
1. show interfaces status err-disabled — which feature shut the port?
2. show port-security interface <if> — violation count and last source MAC.
3. No DHCP address → show ip dhcp snooping — uplink trusted? Option 82 issues?
4. ARP failing → show ip arp inspection statistics vlan <id> — drops?
5. Static host → add a binding or ARP ACL.
feature enabled on the VLAN or port → trusted ports defined → bindings learned or configured → legitimate traffic matches and passes → spoofed or excess traffic dropped and logged
Context & applicabilityCommon mistakes · platform/version boundaries
- Trusting every uplink/access port to make drops disappear.
- Treating any protection drop as evidence of an attack.
- Enabling DAI without planning for static/non-DHCP endpoints.
- Using Port Security maximum 1 on a phone+PC access design without understanding how many source MAC addresses appear.
- Recovering an err-disabled port before identifying the violating secure MAC.
- Troubleshooting DHCP server/pool configuration before checking whether Snooping is blocking the server path.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 First 30 seconds Verify boundary
Immediate answer: Identify the exact Layer-2 protection feature, VLAN and ingress port involved before changing any trust or guard setting.
Verification chain: endpoint/ingress port → edge/trust role → feature scope → binding or guard state → violation/counter → forwarding
Stop condition: A protection feature being enabled somewhere does not show it is attached to the failing VLAN/port or that it caused the observed drop.
Step 2 Step-by-step troubleshooting Narrow the fault
Boundary rule: A protection feature being enabled somewhere does not show it is attached to the failing VLAN/port or that it caused the observed drop.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
Cisco switchport Port Security constrains which source MAC addresses are allowed on an eligible access-style port.
Subtopic DHCP SnoopingDHCP Snooping classifies switch ports as trusted or untrusted for DHCP server-side messages and, when enabled for a VLAN, inspects exchanges to build a binding database containing client MAC, assigned IP address, VLAN, interface and lease information.
Subtopic Dynamic ARP InspectionDynamic ARP Inspection inspects ARP packets on untrusted switch ports and validates address claims against trusted information, commonly the DHCP Snooping binding database.
DHCP snooping must be in place before DAI and IP Source Guard, since both rely on its bindings. Mark uplinks towards the real DHCP server and other switches as trusted. Statically addressed hosts need static bindings or ARP ACLs, or DAI drops them.
show port-security— ports with port security, violations and action.show ip dhcp snooping— VLANs with snooping and trusted ports.show ip dhcp snooping binding— IP-to-MAC bindings learned from DHCP.show ip arp inspection— DAI per VLAN and drop counters.show interfaces status err-disabled— ports shut by a security feature.show errdisable recovery— automatic recovery settings.
ReferenceHow it works1 section · depth on demand
How the three features fit together
Port Security constrains Layer 2 source MAC identity per access port. DHCP Snooping constrains where DHCP server messages may enter and learns valid client IP/MAC/VLAN/interface bindings. DAI then uses trusted boundaries and, for common DHCP clients, those bindings to validate ARP claims. They are complementary controls, not interchangeable features.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Layer 2 security features build on each other
The common Catalyst access-layer protections work as a chain. DHCP snooping learns which IP and MAC address belong on which port. Dynamic ARP Inspection and IP Source Guard then use that binding table to check traffic. Port security limits which MAC addresses a port accepts at all.
| Feature | Stops | Depends on |
|---|---|---|
| Port security | MAC flooding, unknown devices on a port | Nothing |
| DHCP snooping | Rogue DHCP servers, DHCP starvation via spoofed MACs | Trusted uplinks configured correctly |
| Dynamic ARP Inspection | ARP spoofing and man-in-the-middle | DHCP snooping bindings, or ARP ACLs for static hosts |
| IP Source Guard | IP address spoofing | DHCP snooping bindings |
C9300(config)# ip dhcp snooping
C9300(config)# ip dhcp snooping vlan 20,30
C9300(config)# ip dhcp snooping database flash:dhcp-snoop.db
C9300(config)# ip arp inspection vlan 20,30
C9300(config)# interface TenGigabitEthernet1/1/1
C9300(config-if)# ip dhcp snooping trust
C9300(config-if)# ip arp inspection trust
C9300(config)# interface range GigabitEthernet1/0/1 - 46
C9300(config-if-range)# switchport port-security
C9300(config-if-range)# switchport port-security maximum 3
C9300(config-if-range)# switchport port-security violation restrict
C9300# show ip dhcp snooping binding
Why the database matters (from the Catalyst 9300 DHCP guide)
The DHCP guide warns that if the snooping database agent is disabled while DAI or IP Source Guard uses dynamic bindings, the switch can lose connectivity after a reload, because the bindings are gone. Store the bindings in flash or on a server.
Rollout order
| Step | Action |
|---|---|
| 1 | Enable DHCP snooping and trust the uplinks and server ports |
| 2 | Let bindings build for at least one lease period; check show ip dhcp snooping binding |
| 3 | Add ARP ACLs for statically addressed hosts, then enable DAI per VLAN |
| 4 | Enable port security with a maximum that fits phones, PCs behind phones, and docking stations |
Typical breakages
| Symptom | Cause |
|---|---|
| No client gets an address after enabling snooping | Uplink to the DHCP server not trusted |
| Static servers lose ARP after enabling DAI | No ARP ACL for hosts without DHCP bindings |
| Ports err-disabled during a morning login wave | DAI rate limit too low (15 pps by default) or port security maximum too low |
Documented example, not captured output.
Method
Layer 2 security features each close one specific attack inside a VLAN, and several of them depend on each other, so the order of deployment matters. DHCP snooping comes first: it marks which ports may answer DHCP and builds a binding table of IP, MAC, VLAN and port for every client. Dynamic ARP Inspection then uses that table to reject forged ARP replies, and IP Source Guard uses it to drop packets with spoofed source addresses.
Deployment method:
1. Enable DHCP snooping on user VLANs; trust uplinks and DHCP server ports only.
2. Wait until clients have renewed so the binding table is complete.
3. Add static entries (or ARP ACLs) for devices with static IPs.
4. Enable DAI, then IP Source Guard, monitoring drops at each step.
5. Add port security or 802.1X, BPDU Guard and storm control on access ports.
ip dhcp snooping
ip dhcp snooping vlan 20
no ip dhcp snooping information option ! if the DHCP server rejects option 82
interface Te1/1/1
ip dhcp snooping trust
ip arp inspection trust
show ip dhcp snooping binding
show ip arp inspection statistics vlan 20
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Switching → Layer 2 Security. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Quick lookup tables
Layer 2 Security control map
What each control protects and the evidence to read
| Control | Main question | Primary evidence | Typical failure symptom |
|---|---|---|---|
| Port Security | Which source MACs may use this access port? | show port-security interface <interface> | violation/restrict drop/err-disable |
| DHCP Snooping | Which DHCP server path is trusted and what client bindings were learned? | show ip dhcp snooping, show ip dhcp snooping binding | no lease, rogue-server drop, missing binding |
| DAI | Is this ARP claim valid on this VLAN/untrusted port? | show ip arp inspection* | ARP drops, IP works intermittently/no neighbor resolution |