Layer 2 Security & Wireless Security

CCNA 200-301 · Security Fundamentals

By Abu Anns · Last updated 20 November 2026Exam version: 200-301 v1.1 (current until 2 Feb 2027)

Layer 2 is where many real attacks happen, because switches and wireless networks were designed in an era that assumed the local network was trustworthy. A rogue DHCP server, a spoofed ARP reply, or an unauthorised device plugged into a wall socket can all compromise a network without ever touching a firewall. This guide covers the three Layer 2 security features the exam tests — port security, DHCP snooping, and dynamic ARP inspection — plus the wireless security protocols that protect traffic over the air.

Port security

Port security limits which devices can use a switch port by restricting the MAC addresses allowed on it. The classic scenario is a wall socket in a public area: without port security, anyone can plug in a laptop or a rogue switch and join the network. With port security configured, the port accepts frames only from a defined set of MAC addresses. Configuration starts with switchport port-security on an access port (the port must be in access mode or a trunk with explicit configuration — port security will not work on a dynamic port). switchport port-security maximum 2 sets how many MAC addresses are allowed, and switchport port-security mac-address sticky tells the switch to learn the addresses dynamically from incoming frames and remember them, adding them to the running configuration automatically.

When a frame arrives from an unauthorised MAC address, the violation mode decides what happens. Protect drops the unauthorised frames silently, with no notification. Restrict drops the frames and logs the violation (and can send an SNMP trap). Shutdown — the default — drops the frames and error-disables the port entirely, taking it out of service until an administrator re-enables it with shutdown followed by no shutdown. The exam tests which mode does what, and the key distinction is that only shutdown disables the port; protect and restrict only drop the offending traffic. Verify with show port-security and show port-security interface GigabitEthernet0/1.

DHCP snooping and dynamic ARP inspection

DHCP snooping protects against rogue DHCP servers. An attacker who plugs in a DHCP server can hand out false gateway and DNS addresses, redirecting victims' traffic through the attacker's machine. DHCP snooping divides switch ports into trusted (ports facing the legitimate DHCP server or an uplink to another switch) and untrusted (all client-facing ports, the default). DHCP server messages — Offers and Acknowledgements — arriving on an untrusted port are dropped, so a rogue server's answers never reach clients. While it inspects DHCP traffic, the switch also builds a DHCP snooping binding table recording which MAC address legitimately holds which IP address on which port and VLAN — a table that dynamic ARP inspection then relies on. Enable it globally with ip dhcp snooping, per VLAN with ip dhcp snooping vlan 10, and mark trusted ports with ip dhcp snooping trust. DHCP snooping can also rate-limit DHCP requests on untrusted ports to blunt DHCP starvation attacks, where an attacker floods requests to exhaust the address pool.

Dynamic ARP inspection (DAI) protects against ARP spoofing (also called ARP poisoning), where an attacker sends fake ARP replies claiming that the attacker's MAC address belongs to the gateway's IP address, so victims send their traffic to the attacker. DAI intercepts ARP packets on untrusted ports and checks each one against the DHCP snooping binding table: if the sender's MAC and IP address match a legitimate binding, the ARP packet is forwarded; if not, it is dropped and logged. Enable it with ip arp inspection vlan 10, and trust the ports facing routers and other switches with ip arp inspection trust. The exam's key point is the dependency: DAI depends on the DHCP snooping binding table, so DAI is only effective on VLANs where DHCP snooping is also running.

Wireless security protocols

Wireless traffic travels through the air, so anyone in range can capture it — encryption is the only thing standing between a wireless network and anyone with a laptop nearby. WEP (Wired Equivalent Privacy) was the first wireless security protocol, using RC4 encryption with short static keys. It is thoroughly broken: its keys can be recovered in minutes, and it should never be used. WPA (Wi-Fi Protected Access) replaced WEP as a stopgap, introducing TKIP (Temporal Key Integrity Protocol) with per-packet keys and message integrity checks. WPA2 is the full standard (IEEE 802.11i), using AES encryption with CCMP — it has been the baseline for secure wireless for years and is what the exam expects you to configure. WPA3 is the current generation: it replaces the pre-shared key exchange with SAE (Simultaneous Authentication of Equals), which resists offline dictionary attacks and provides forward secrecy (captured traffic cannot be decrypted later even if the password is discovered), and it offers a 192-bit security mode for enterprise environments.

Each protocol comes in two modes. Personal (PSK) mode uses a single shared passphrase for all users — simple, and the right choice for homes and small offices. Enterprise mode uses 802.1X authentication against a RADIUS server, giving each user individual credentials and unique encryption keys — the right choice for any organisation. In the WLC GUI, configuring a WPA2 PSK WLAN means creating the WLAN, choosing WPA2 with AES encryption under the Layer 2 security settings, selecting PSK as the authentication key management method, and entering the passphrase. The exam may show a GUI screenshot or describe these settings and ask you to identify what is being configured.

Putting Layer 2 security together

These three features are usually deployed together, and the exam tests them as a system. Port security controls which devices can connect at all; DHCP snooping controls which devices can hand out addresses; and DAI controls which devices can claim an address in ARP. The deployment order matters: enable DHCP snooping first, because DAI needs its binding table, and verify the binding table with show ip dhcp snooping binding before enabling DAI — if the table is empty, DAI will drop legitimate ARP traffic. Trust the right ports in both features: uplinks toward other switches, routers, and the DHCP server are trusted, and everything facing endpoints is untrusted. A common exam scenario shows DAI dropping legitimate traffic and asks why: the usual answer is that a port facing a router was left untrusted, so the router's ARP replies were dropped. Another shows a port in err-disabled state and asks what happened: port security in shutdown mode is the usual suspect, and the fix is to find the unauthorised device, remove it, and re-enable the port with shutdown followed by no shutdown — or to configure errdisable recovery so the port recovers automatically after a timer expires.

Advertisement

Exam traps to watch for

Practice questions

Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.

Q1.A switch port is configured with port security in restrict mode. A frame arrives from an unauthorised MAC address. What happens?

Report an error

Q2.What does the switchport port-security mac-address sticky command do?

Report an error

Q3.An attacker connects a rogue DHCP server to a client-facing switch port. Which feature prevents clients from receiving the attacker's DHCP offers?

Report an error

Q4.How does dynamic ARP inspection (DAI) decide whether an ARP packet is legitimate?

Report an error

Q5.Which wireless security protocol is considered broken and should never be used?

Report an error

Q6.What is the main security improvement of WPA3 over WPA2?

Report an error

Q7.A company wants each wireless user to authenticate with individual credentials checked against a central server, rather than sharing one passphrase. Which wireless security mode should be used?

Report an error

Q8.In the WLC GUI, an engineer configures a WLAN with WPA2, AES encryption, and PSK authentication. What must also be provided for clients to connect?

Report an error

Q9.A switch port with port security configured in shutdown mode (the default) detects a violation and goes err-disabled. How does an administrator restore the port?

Report an error