By the end of this lesson you can
- Use threat, vulnerability, exploit and mitigation correctly
- Configure port security with limits, sticky learning and violation modes
- Configure DHCP snooping and explain how DAI uses it
- Compare TACACS+ and RADIUS and configure AAA with a local fallback
- Describe site to site and remote access VPNs and password alternatives
Security language and the human layer
| Term | Meaning | Example |
|---|---|---|
| Threat | Who or what could cause harm | A scammer, malware, a careless insider |
| Vulnerability | The weakness | An open switch port in a meeting room |
| Exploit | The method that uses the weakness | Plugging in a rogue DHCP server |
| Mitigation | The control that reduces the risk | DHCP snooping, port security |
A security programme is more than device configuration: user awareness (recognising phishing and scams, the topic of much of this site), training for the people who run systems, and physical access control (badges, locked wiring closets, no spare live ports in public areas). Most breaches still start with a stolen password or a convincing message, which is why MFA belongs in network security too.
Passwords alone are weak. Alternatives and additions: multi factor authentication (something you know plus something you have or are), certificates (a device or user proves itself with a private key), and biometrics. In password policy, length beats forced complexity, and checking new passwords against known breached lists helps more than frequent forced changes.
Port security
A switch learns MAC addresses into a table of limited size. A CAM (MAC) flooding attack sends frames from thousands of fake source MACs until the table is full, after which some switches flood unknown unicast traffic out of every port, where the attacker can capture it. Port security limits how many MACs a port may use.
| Setting | Default | Notes |
|---|---|---|
switchport port-security maximum N | 1 | MAC addresses allowed on the port |
switchport port-security violation | shutdown | protect: drop silently. restrict: drop, log and count. shutdown: err-disable the port. |
switchport port-security mac-address sticky | off | Learned MACs are written into the running config (save to keep them). |
SW1(config)#interface range Fa0/1 - 2
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 10
SW1(config-if-range)#switchport port-security
SW1(config-if-range)#switchport port-security maximum 2
SW1(config-if-range)#switchport port-security mac-address sticky
SW1(config-if-range)#switchport port-security violation restrictPort security only works on a port that is statically access (or trunk); a dynamic (DTP) port rejects it. An err-disabled port comes back with shutdown then no shutdown once the cause is removed. Port security does not stop someone copying an allowed MAC address. 802.1X, which authenticates the device or user before the port opens, is the stronger control.
DHCP snooping and Dynamic ARP Inspection
DHCP snooping splits switch ports into trusted (toward the real DHCP server, and uplinks) and untrusted (everything else). Server messages such as Offer and Ack arriving on an untrusted port are dropped, so a rogue server on a user port cannot hand out a fake gateway or DNS. Snooping also builds a binding table of MAC, IP, VLAN, port and lease for every client, and can rate limit DHCP on untrusted ports to slow starvation attacks.
SW1(config)#ip dhcp snooping
SW1(config)#ip dhcp snooping vlan 10
SW1(config)#no ip dhcp snooping information option
SW1(config)#interface Fa0/24
SW1(config-if)#ip dhcp snooping trust
SW1(config)#interface range Fa0/1 - 10
SW1(config-if-range)#ip dhcp snooping limit rate 10You need both the global command and the per VLAN command. When snooping is on, the switch inserts DHCP option 82 by default; a server that is not expecting it may ignore those requests, which is why labs often turn it off.
Dynamic ARP Inspection (ip arp inspection vlan 10) inspects ARP packets on untrusted ports and drops any whose IP to MAC pairing is not in the binding table. Trust the uplinks and the server port with ip arp inspection trust. Devices with static addresses have no binding, so on real gear they need trust or an ARP ACL, or their ARP is dropped. Snooping alone does not stop ARP spoofing; it only builds the table DAI uses.
AAA, TACACS+ and RADIUS
Local usernames on every device do not scale: when an engineer leaves, someone has to remove them from 400 switches. AAA moves the decision to a server: authentication (who are you), authorization (what may you do), accounting (what did you do).
| TACACS+ | RADIUS | |
|---|---|---|
| Transport | TCP 49 | UDP 1812 and 1813 (older 1645 and 1646) |
| Encryption | Whole payload | Only the password |
| The three A's | Separate, so per command authorization is possible | Authentication and authorization combined |
| Typical use | Device administration | Network access: 802.1X, VPN, Wi-Fi |
| Origin | Cisco originated, now documented in RFC 8907 | Open standard |
R1(config)#username backup secret <a long local password>
R1(config)#tacacs-server host 10.0.0.20 key <shared key>
R1(config)#aaa new-model
R1(config)#aaa authentication login default group tacacs+ local
R1(config)#line vty 0 4
R1(config-line)#login authentication default
R1(config-line)#transport input sshThe method list is tried in order: the TACACS+ server first, and the local database only if the server cannot be reached (not if it says no). Keep one local account for that emergency, with a long secret that is rarely used and closely watched. Run aaa new-model only once you have that account and an open console session, because it changes login behaviour immediately.
VPNs (concept): an IPsec site to site VPN joins two networks across the internet through their gateways; a remote access VPN connects one user's device, using client software or a browser based TLS portal. IPsec provides confidentiality, integrity, authentication and anti-replay. A VPN protects traffic in transit; it does nothing about malware already on the laptop.
Practise on SW1
SW1 is a 2960. VLAN 10 exists, Fa0/24 (real DHCP server) and Fa0/10 (Admin-PC) are already access ports in VLAN 10, Gi0/1 is the trunk to R1. Fa0/1 to Fa0/3 have not been touched. Fa0/3 has a small hub with two devices behind it, one of them the rogue server. The DHCP clients are modelled by the console.
Missions 0/12
Flashcards: do you remember?
Tap a card to flip it. Try to answer in your head first; recalling is what makes it stick.
Quick quiz
Instant feedback on every answer. Score 70% or more to pass this lesson's quiz.
Q1A rogue DHCP server is on Fa0/3. Which feature stops its offers?
Server messages on untrusted ports are dropped.
Q2Which violation mode drops, logs and counts but keeps the port up?
protect drops silently; shutdown err-disables.
Q3DHCP snooping is on. Does it stop ARP spoofing by itself?
DAI does the ARP checking.
Q4Which protocol encrypts the whole AAA payload?
RADIUS encrypts only the password.
Q5With aaa authentication login default group tacacs+ local, the server rejects a password. What happens?
Fallback only happens when the server is unreachable.
Q6An attacker sends frames from thousands of random MACs. What is this and what limits it?
Port security caps MACs per port.
Hands-on lab
Packet Tracer lab 3.12: lock down the access layer and centralise logins
You need: Cisco Packet Tracer (free with a Cisco Networking Academy account; version 9.0.1 was the current download on the NetAcad Resource Hub when this lesson was written). Devices: 1 x 2960, 1 x ISR4331, 3 x Server-PT (Server-DHCP, Rogue-Server, Server-AAA), 3 x PC-PT. All SW1 user ports in VLAN 10.
Simulator lab, zero risk. This lab runs inside Cisco Packet Tracer, so it touches no real network. Packet Tracer is free with a Cisco Networking Academy account (netacad.com). It simulates a subset of Cisco IOS, so where support for a feature is uncertain we say so instead of promising it works.
Topology and addressing
| Device | Interface | IPv4 address / prefix | Default gateway or note |
|---|---|---|---|
| R1 | Gi0/0/0 / Gi0/0/1 | 192.168.10.1/24 / 10.0.0.1/24 | |
| SW1 | VLAN 10 | 192.168.10.2/24 | gateway 192.168.10.1 |
| Server-DHCP | Fa0 | 192.168.10.5/24 | pool from .100, gateway .1 |
| Rogue-Server | Fa0 | 192.168.10.6/24 | pool from .200, gateway .6 (the bad gateway) |
| Server-AAA | Fa0 | 10.0.0.20/24 | gateway 10.0.0.1, TACACS+ and RADIUS |
| Admin-PC | Fa0 | 192.168.10.50/24 | static |
See the problem
With no protection, release and renew DHCP on PC1 and PC2 a few times (IP Configuration, switch to Static and back to DHCP). Some leases may come from the rogue server: a .200 address with gateway .6.
DHCP snooping
SW1(config)#ip dhcp snooping SW1(config)#ip dhcp snooping vlan 10 SW1(config)#no ip dhcp snooping information option SW1(config)#interface Fa0/24 SW1(config-if)#ip dhcp snooping trust SW1(config)#interface range Fa0/1 - 10 SW1(config-if-range)#ip dhcp snooping limit rate 10Renew on the PCs: only the real server's addresses should appear now.
Dynamic ARP Inspection
SW1(config)#ip arp inspection vlan 10 SW1(config)#interface Fa0/24 SW1(config-if)#ip arp inspection trust SW1(config)#interface Gi0/1 SW1(config-if)#ip arp inspection trustOn real gear, Admin-PC with its static address would also need trust or an ARP ACL.
Port security
SW1(config)#interface range Fa0/1 - 2 SW1(config-if-range)#switchport mode access SW1(config-if-range)#switchport access vlan 10 SW1(config-if-range)#switchport port-security SW1(config-if-range)#switchport port-security maximum 2 SW1(config-if-range)#switchport port-security mac-address sticky SW1(config-if-range)#switchport port-security violation restrict SW1(config)#interface Fa0/3 SW1(config-if)#switchport mode access SW1(config-if)#switchport port-security SW1(config-if)#switchport port-security violation shutdownPut a hub on Fa0/3 with two devices behind it, or swap the device on the port, and send traffic to trigger the violation.
AAA on R1
On Server-AAA, Services, AAA: add client R1 (10.0.0.1, key of your choice, type TACACS) and a user.
R1(config)#username backup secret <a long local password> R1(config)#tacacs-server host 10.0.0.20 key <the key> R1(config)#aaa new-model R1(config)#aaa authentication login default group tacacs+ local R1(config)#line vty 0 4 R1(config-line)#login authentication default R1(config-line)#transport input sshSSH from Admin-PC with the server account. Then turn off the AAA service on the server and confirm the backup account still works. Optional: repeat with
radius-server hostandgroup radius local.Verify
SW1#show ip dhcp snooping SW1#show ip dhcp snooping binding SW1#show ip arp inspection vlan 10 SW1#show port-security SW1#show port-security interface Fa0/1 SW1#show interfaces status err-disabled SW1#show running-config | include sticky R1#show users
You are done when: PCs only get .100 and up after snooping; the binding table lists PC1 and PC2; show port-security shows Fa0/1 and Fa0/2 with maximum 2 and Fa0/3 err-disabled after the violation; SSH to R1 works with the server account and, with the server off, with the backup account.
Packet Tracer limits and notes
- DHCP snooping works on the 2960 in Packet Tracer, but the binding table output can be sporadic, per Wendell Odom's CCNA lab notes for PT 8.0 (certskills.com). The same notes say it could be configured on the 3650 but only worked on 2960s in their testing.
- Dynamic ARP Inspection: per the same source, Packet Tracer 8.0 accepts the DAI commands but does not actually filter bad ARP, and may show the VLAN as inactive. Treat DAI as configuration practice, not a working defence demo. Whether newer builds behave better is UNVERIFIED.
- Port security works on the 2960 in Packet Tracer in the outline author's experience. AAA with TACACS+ and RADIUS against Server-PT is supported in that experience too; the newer named syntax (
tacacs server NAME) is UNVERIFIED, so this lab usestacacs-server host.show aaa serversis also UNVERIFIED. - IPsec VPN configuration is outside CCNA scope and Packet Tracer's depth of support is UNVERIFIED, so VPNs stay conceptual.
- Packet Tracer simulates a subset of IOS. If a command here is rejected in your version, note it, skip that step and carry on; the concept still applies to real Cisco gear.
Download the lab checklist (.txt) Print it or keep it open beside Packet Tracer.
Key takeaways
- Name the threat, the vulnerability, the exploit and the mitigation.
- Port security caps MACs per port; default is 1 MAC and shutdown.
- DHCP snooping trusts only server-facing ports and builds the binding table.
- DAI uses that table to drop spoofed ARP.
- AAA centralises logins; keep a rarely used local fallback.
- MFA and awareness are part of network security.
Finished the sections, quiz and lab? Mark the lesson complete. Progress is saved only in this browser.