Chapter 5: Security Fundamentals
Security is one of the largest CCNA domains, and it is where memorized definitions meet real incidents. This chapter covers threats, VPNs, access control lists, Layer 2 defenses, device hardening, and wireless security. Cisco loves testing the differences between similar technologies — watch for every comparison table.
5.1 Security Concepts: Know Your Enemy
5.1.1 Malware
| Type | How it spreads | What it does |
|---|---|---|
| Virus | Attaches to a host program; needs user action to spread | Infects files, corrupts data |
| Worm | Self-replicating; no host, no user action needed | Spreads across networks, consumes resources |
| Trojan | Disguised as legitimate software the user installs | Opens backdoors, steals data |
| Ransomware | Delivered by phishing or trojans | Encrypts files, demands payment |
| Spyware | Bundled downloads, silent installs | Secretly monitors; keyloggers steal passwords via keystrokes |
| Rootkit | Installed by other malware | Hides itself and attacker tools from the OS |
The most tested malware fact: a virus needs a host and a human; a worm spreads itself. Malware moving across the network with nobody clicking anything is a worm.
Scenario: "users report encrypted files and a ransom note" — ransomware; the exam-correct response is backups and incident response, not paying. "Keylogger" is a type of spyware, not a separate top-level category.
5.1.2 Social Engineering and Phishing
Social engineering attacks the human. Phishing: fraudulent messages impersonating a trusted sender to steal credentials or deliver malware. Variants: spear phishing (targeted at a person/org), whaling (aimed at executives), vishing (voice calls), smishing (SMS), pretexting (invented scenario, e.g. fake IT support), baiting (lure such as a free USB drive), tailgating (following someone through a secured door).
The defense against social engineering is user training and verification procedures, not technology. "Security awareness training" beats any firewall answer.
5.1.3 Denial of Service
DoS overwhelms a target from a single source so legitimate users can't get through. DDoS does it from many sources at once — typically a botnet of compromised devices — making it far harder to stop. Mitigations: rate limiting, filtering, and cloud scrubbing services that absorb the flood upstream.
5.1.4 Man-in-the-Middle
In a MITM attack, the attacker secretly sits between two parties, intercepting or altering traffic. Examples: ARP spoofing on a LAN (poisoned ARP caches redirect traffic through the attacker) and evil-twin access points mimicking a legitimate SSID. Defenses: encryption, mutual authentication, VPNs, and Dynamic ARP Inspection (5.4.2).

5.2 VPNs
A VPN builds an encrypted tunnel across an untrusted network (usually the internet) so private traffic travels safely.
5.2.1 Site-to-Site vs. Remote-Access
| Site-to-site | Remote-access | |
|---|---|---|
| Connects | Entire networks (branch to HQ) | Individual users to the corporate net |
| Endpoints | Routers/firewalls at each site | VPN client on the user's device |
| Availability | Always on | On demand |
| Typical protocol | IPsec | IPsec or SSL/TLS |
"Traveling employee needs access from a hotel" = remote-access. "Connect the Chicago and Dallas offices permanently" = site-to-site. Match the scenario.
5.2.2 IPsec Fundamentals
IPsec secures IP traffic, most often for site-to-site VPNs. Its two core protocols are a classic exam trap:
- AH (Authentication Header, IP protocol 51) — authentication and integrity only. No encryption.
- ESP (Encapsulating Security Payload, IP protocol 50) — encryption plus authentication/integrity.
AH = authentication only. ESP = encryption. When a question demands confidentiality, the answer is ESP.
Two modes: transport mode encrypts only the payload (original IP header visible) — used host-to-host. Tunnel mode encrypts the entire packet inside a new IP header — used gateway-to-gateway (site-to-site).
IKE (Internet Key Exchange) sets up the tunnel: Phase 1 builds a secure channel between peers (authentication plus Diffie-Hellman key exchange); Phase 2 negotiates the IPsec security associations that protect the data.
5.2.3 SSL VPNs
SSL/TLS VPNs use web-style encryption. Clientless mode needs only a browser; full-tunnel client mode (e.g. Cisco AnyConnect) gives complete network access like IPsec remote-access. Advantage: easy firewall traversal over TCP 443.
5.3 Access Control Lists
An ACL is an ordered permit/deny list checked top-down, first match wins. No match hits the implicit deny all at the end — the most tested ACL fact on the exam.
5.3.1 Standard vs. Extended
| Standard | Extended | |
|---|---|---|
| Numbers | 1–99, 1300–1999 | 100–199, 2000–2699 |
| Filters on | Source IP only | Source/destination IP, protocol, ports |
| Placement | Close to the destination | Close to the source |
Placement exists for one reason: a standard ACL sees only the source, so placing it near the source blocks that source everywhere. Extended ACLs are precise enough to live near the source. Expect "where do you place it and why" questions.
Named ACLs (ip access-list extended BLOCK-TELNET) allow descriptive names and per-line editing — numbered ACLs force you to rebuild the list to remove a line.
R1(config)# ip access-list extended BLOCK-TELNET
R1(config-ext-nacl)# deny tcp 192.168.10.0 0.0.0.255 host 192.168.20.5 eq 23
R1(config-ext-nacl)# permit ip any any
R1(config-ext-nacl)# exit
R1(config)# interface gigabitEthernet 0/0
R1(config-if)# ip access-group BLOCK-TELNET in
The explicit permit ip any any is mandatory — otherwise the implicit deny kills everything else. One ACL per interface, per direction (in/out), per protocol.
5.3.2 Wildcard Masks
A wildcard mask is the inverse of a subnet mask: 0 = bit must match, 1 = bit ignored.
Derive the wildcard mask for 10.1.4.0/22.
Step 1: /22 subnet mask = 255.255.252.0.
Step 2: Subtract each octet from 255: 255−255=0; 255−255=0; 255−252=3; 255−0=255.
Final answer: 0.0.3.255 → permit 10.1.4.0 0.0.3.255.
ACL entry: deny tcp 172.16.0.0 0.0.255.255 any eq 23. Does a Telnet packet from 172.16.5.9 match?
Step 1: Wildcard 0.0.255.255 — first two octets must match exactly, last two ignored.
Step 2: 172.16.5.9 vs 172.16.0.0 — 172=172, 16=16, rest ignored. Address matches.
Step 3: Protocol TCP, destination port 23 — both match.
Final answer: yes, the packet is denied. The entry covers all of 172.16.0.0/16 for Telnet.
0.0.0.0 = match one exact host (like the host keyword). 255.255.255.255 = match any address (like any).
Write the wildcard mask for 192.168.50.128/26.
Show solution
/26 mask = 255.255.255.192. Subtract: 0.0.0.63. Entry: permit 192.168.50.128 0.0.0.63. (Shortcut: block size 64 → wildcard is one less, 63.)
The server at 10.0.0.50 must allow web (TCP 80) from subnet 10.0.1.0/24 but block Telnet (TCP 23) from that subnet; all else flows. Standard or extended ACL, and where?
Show solution
Extended, as close to the source (users) as possible. A standard ACL filters only on source address — it cannot tell Telnet from web, so it would block everything from 10.0.1.0/24. Only an extended ACL matches destination ports (eq 23 vs eq 80). End with permit ip any any or the implicit deny breaks all other traffic.
5.4 Layer 2 Security
Switches forward frames without asking questions, so Layer 2 needs explicit defenses. These four work as a team.
5.4.1 DHCP Snooping
Stops rogue DHCP servers handing out bogus gateways/DNS to redirect traffic. Ports are trusted (uplinks toward the real DHCP server) or untrusted (everything else, the default); DHCP server messages (OFFER, ACK) on untrusted ports are dropped. It also builds a binding table (MAC–IP–port–VLAN) that powers DAI.
SW1(config)# ip dhcp snooping
SW1(config)# ip dhcp snooping vlan 10
SW1(config)# interface gigabitEthernet 0/1
SW1(config-if)# ip dhcp snooping trust
Trust the uplink, distrust the edge. Forgetting to trust the uplink is the classic lab mistake — suddenly nobody gets an IP.
5.4.2 Dynamic ARP Inspection
DAI stops ARP spoofing (the classic MITM setup) by checking ARP packets on untrusted ports against the DHCP snooping binding table and dropping mismatches. No binding table = nothing to validate, so DAI requires DHCP snooping. Static-IP devices need static mappings or ARP ACLs.
5.4.3 Port Security
Limits MAC addresses per port, defeating MAC flooding and rogue devices:
| Violation mode | Action | Default? |
|---|---|---|
| shutdown | Port goes err-disabled; manual recovery needed | Yes |
| restrict | Drops frames, sends SNMP/syslog, port stays up | No |
| protect | Silently drops frames, no notification | No |
SW1(config)# interface gigabitEthernet 0/5
SW1(config-if)# switchport mode access
SW1(config-if)# switchport port-security
SW1(config-if)# switchport port-security maximum 2
SW1(config-if)# switchport port-security violation restrict
SW1(config-if)# switchport port-security mac-address sticky
Sticky MACs learn and remember the first MACs seen — no manual entry needed. Port security requires an access port (switchport mode access first). Default maximum is 1 MAC.
A user plugs a small unmanaged switch into a wall jack (PortFast port, default port-security). The port goes err-disabled within seconds. Which two mechanisms are most likely responsible?
Show solution
1. BPDU Guard — the downstream switch sends BPDUs; a PortFast port receiving a BPDU err-disables immediately. 2. Port security (shutdown mode) — the default max of 1 MAC is exceeded the moment a second device appears. BPDU Guard usually fires first since BPDUs arrive instantly.
5.4.4 Spanning-Tree Guards and VLAN Best Practices
- BPDU Guard: on PortFast edge ports — err-disables the port if any BPDU arrives. No rogue switches in your spanning tree.
- Root Guard: on downstream-facing ports — blocks superior BPDUs so no switch can steal the root bridge role.
- Native VLAN: default VLAN 1 carries untagged trunk traffic and invites VLAN hopping (double-tagging). Harden it: move the native VLAN to an unused VLAN, never put users on VLAN 1, tag native traffic where supported, prune unused VLANs from trunks.
"Prevent a rogue switch from becoming root?" = Root Guard. "Shut down a PortFast port that receives a BPDU?" = BPDU Guard. One guards the role, the other the edge port.

5.5 Device Hardening
5.5.1 Passwords, SSH, and Banners
- enable secret hashes the privileged password; enable password stores it in clear text — always use
enable secret. - service password-encryption hides other passwords with weak, reversible encryption. Better than clear text, not real security.
- SSH vs Telnet: Telnet (TCP 23) sends everything in clear text; SSH (TCP 22) encrypts. Disable Telnet. SSH needs a hostname, domain name, and RSA key:
R1(config)# hostname R1
R1(config)# ip domain-name certcrack.lab
R1(config)# crypto key generate rsa modulus 2048
R1(config)# ip ssh version 2
R1(config)# line vty 0 4
R1(config-line)# transport input ssh
R1(config-line)# login local
R1(config-line)# exit
R1(config)# username admin privilege 15 secret Str0ngP@ss!
transport input ssh is what actually kills Telnet on the VTY lines.
- Banners (
banner motd,banner login): legal "authorized access only" warnings. They don't stop attackers, but they establish unauthorized access legally.
Given a VTY config on the exam, check three things: transport input ssh, login local (with a username defined), and no Telnet.
5.5.2 Disable What You Don't Use
Every running service is attack surface: no ip http server, disable CDP/LLDP on untrusted edges, and shut down unused switch ports (or park them in a dead-end VLAN). An enabled, unconfigured port is an open door.
5.5.3 AAA: TACACS+ vs. RADIUS
AAA = Authentication (who are you?), Authorization (what may you do?), Accounting (what did you do?). Centralize it on a server (e.g. Cisco ISE) instead of local passwords per device.
| TACACS+ | RADIUS | |
|---|---|---|
| Origin | Cisco-proprietary | Open standard |
| Transport | TCP 49 | UDP 1812 / 1813 |
| Encryption | Entire packet | Password only |
| AAA handling | Separates auth, authz, acct | Combines auth + authz |
| Best for | Device administration | Network access (802.1X, VPN, wireless) |
"Encrypts the entire payload, TCP 49" = TACACS+. "Open standard over UDP" = RADIUS. Use-case split: TACACS+ administers devices; RADIUS authenticates users onto the network.
Centralized auth for 40 routers/switches is needed. Requirements: authorization separate from authentication, and all exchanged data encrypted — not just passwords. Which protocol, and why is the other wrong?
Show solution
TACACS+: it separates authentication, authorization, and accounting, encrypts the full packet, and runs over TCP 49. RADIUS is wrong here because it merges authentication with authorization and encrypts only the password. (RADIUS would be right for a different job, like 802.1X user logins.)
5.6 Wireless Security
Wireless frames reach anyone listening, so encryption and strong authentication are mandatory. WEP is broken — know it only to reject it. WPA was interim and is deprecated. The real comparison:
| WPA2 | WPA3 | |
|---|---|---|
| Personal handshake | PSK (4-way handshake) | SAE (Simultaneous Authentication of Equals) |
| Dictionary attacks | Vulnerable to offline brute force | Resistant by design |
| Forward secrecy | No | Yes |
| Encryption | AES-128 (CCMP) | AES-128, optional 192-bit (Enterprise) |
| Management frames | Unprotected by default | PMF required |
WPA2 was weakened by the KRACK attack (2017) on its handshake. WPA3 comes in Personal (passphrase) and Enterprise (802.1X/EAP with RADIUS — see 5.5.3) modes.
WPA3 replaces the PSK handshake with SAE → forward secrecy + resistance to offline dictionary attacks. Either benefit named in a question means WPA3.
An office uses WPA2-Personal with passphrase "summer2024". An attacker captures the 4-way handshake. (a) What attack is now practical? (b) Which WPA3 feature would have prevented it?
Show solution
(a) Offline dictionary/brute-force attack on the captured handshake — "summer2024" falls in seconds. (b) SAE. WPA3-Personal's SAE handshake resists offline dictionary attacks, and forward secrecy means a later password leak can't decrypt old captures.
End-of-Chapter Test
permit tcp 10.1.0.0 0.0.255.255 any eq 80. Which source address matches? A. 10.1.5.20 B. 10.2.5.20 C. 192.168.1.5 D. 11.1.0.5
---