Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Layer 2 Security

Direct answer

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.

When to use this

Use it when hardening access ports, or when a legitimate host is blocked, err-disabled or gets no address.

First 30 seconds

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.

Operational verification

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
Common mistakes
Common mistakes
  • 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.

Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE · Cisco IOS XE
Scope / prerequisiteUse it when hardening access ports, or when a legitimate host is blocked, err-disabled or gets no address.
What next?3 suggested next steps
Child topics (this level)3
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Command lookup Jump straight to Cisco syntax
Drill down

Subtopics

Go one level deeper into this subject.

Key points

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.

Key checks
  • 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.
ReferenceWhy it matters1 section · depth on demand

Why it matters

Use Layer 2 Security to reduce common campus-LAN risks such as unauthorized MAC addresses, rogue DHCP servers and ARP spoofing while keeping enforcement close to the access port where identity enters the network.

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.

FeatureStopsDepends on
Port securityMAC flooding, unknown devices on a portNothing
DHCP snoopingRogue DHCP servers, DHCP starvation via spoofed MACsTrusted uplinks configured correctly
Dynamic ARP InspectionARP spoofing and man-in-the-middleDHCP snooping bindings, or ARP ACLs for static hosts
IP Source GuardIP address spoofingDHCP 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

StepAction
1Enable DHCP snooping and trust the uplinks and server ports
2Let bindings build for at least one lease period; check show ip dhcp snooping binding
3Add ARP ACLs for statically addressed hosts, then enable DAI per VLAN
4Enable port security with a maximum that fits phones, PCs behind phones, and docking stations

Typical breakages

SymptomCause
No client gets an address after enabling snoopingUplink to the DHCP server not trusted
Static servers lose ARP after enabling DAINo ARP ACL for hosts without DHCP bindings
Ports err-disabled during a morning login waveDAI rate limit too low (15 pps by default) or port security maximum too low

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Embedded reference data

Quick lookup tables

Layer 2 Security control map

What each control protects and the evidence to read

ControlMain questionPrimary evidenceTypical failure symptom
Port SecurityWhich source MACs may use this access port?show port-security interface <interface>violation/restrict drop/err-disable
DHCP SnoopingWhich DHCP server path is trusted and what client bindings were learned?show ip dhcp snooping, show ip dhcp snooping bindingno lease, rogue-server drop, missing binding
DAIIs this ARP claim valid on this VLAN/untrusted port?show ip arp inspection*ARP drops, IP works intermittently/no neighbor resolution
Confirmation

Confirm action

Continue?