ACLs

An ACL is read top to bottom, and the first match decides

ip access-list extended TO-SERVERS10 permit tcp 10.1.20.0 0.0.0.255 host 10.9.0.80 eq 44320 deny   tcp any host 10.9.0.80 eq 2230 permit icmp 10.1.0.0 0.0.255.255 any echo   (implicit) deny ip any anyA✓A 10.1.20.15 → 10.9.0.80 TCP 443line 10: permitB·✗B 10.1.30.7 → 10.9.0.80 TCP 22line 20: denyC···✗C 10.1.30.7 → 10.9.0.80 TCP 443no line matches: denyAn ACL is read top to bottom; the first line that matches decides, and anything that matches nothing is denied.Packet A matches line 10 and is permitted. B matches line 20 and is dropped. C comes from 10.1.30.0, so line 10 does not match;nothing else does either, and the invisible last line denies it. Order matters: put specific lines first, and remember that anACL with only deny lines blocks everything.

An ACL is checked line by line; the first match permits or denies, and an implicit deny drops everything that matches nothing.

ACLs · Going deeper

Standard and extended ACLs, wildcard masks and placement

StandardExtendedPlacementMatchessource address onlyprotocol, source, destination, portsNumbers1–99, 1300–1999100–199, 2000–2699Place itnear the destinationnear the sourceso it drops earlyWildcard mask = inverted subnet mask: 0 bits must match, 1 bits are ignored10.1.20.0/24 → wildcard 0.0.0.25510.1.16.0/20 → wildcard 0.0.15.255/32 → 0.0.0.0, written host 10.9.0.80/0 → 255.255.255.255, written anyStandard ACLs match only the source, so they sit near the destination; extended ACLs sit near the source.Apply an ACL to an interface in one direction: in (before routing) or out (after). Each interface allows one ACL per directionand per protocol. Named ACLs can be edited line by line by sequence number. The wildcard mask is the inverse of the subnetmask, so 0.0.0.255 means “the first three octets must match”. ACLs also select traffic for NAT, QoS and VPNs.

Standard ACLs match only the source and go near the destination; extended ACLs go near the source. A wildcard mask inverts the subnet mask.

Firewalls

A stateful firewall remembers conversations and separates zones

Inside · trusteddatabaseStateful firewallOutside · untrustedinternetinside → out ✓, replies return by stateScreened subnet (DMZ)web serverout → web 443 ✓web → database 1433 only ✓outside → inside ✗ deniedA stateful firewall tracks each connection, lets replies back in, and keeps public servers in their own zone.An ACL judges each packet alone, so return traffic needs its own rule. A stateful firewall records outgoing connections and admitsonly matching replies. Servers that the internet must reach sit in a screened subnet (DMZ), allowed to reach inside only onspecific ports. Next-generation firewalls also identify applications and users, inspect TLS and block intrusions (IPS).

A stateful firewall lets replies back in automatically; public servers sit in a screened subnet (DMZ) between trusted and untrusted zones.

VPNs

A VPN carries private traffic across the internet, encrypted

Head office 10.1.0.0/16Branch 10.2.0.0/16site-to-site IPsec tunnel over the internetRemote user: TLS VPN on 443, or IPsecESP tunnel mode, AES-GCM: a 1400-byte packet becomes 1456 bytesnew IP 20ESP 8IV 8original packet 1400, encryptedICV 16A VPN wraps private traffic in an encrypted packet, joining sites or remote users across the internet.IPsec negotiates keys with IKE (UDP 500, or 4500 through NAT) and carries data in ESP (IP protocol 50), which encrypts andauthenticates; AH (51) only authenticates. Tunnel mode adds a new IP header: here 56 bytes, so the inner MTU must shrink.Remote access VPNs use TLS on 443 or IPsec. A full tunnel sends everything through the office; a split tunnel only office traffic.

IPsec joins sites with ESP (protocol 50) and IKE (UDP 500/4500); remote users use TLS or IPsec. Tunnel mode turned 1400 bytes into 1456.

Access control

802.1X keeps a port shut until the user proves who they are

Supplicantthe user’s deviceAuthenticatorswitch or APAuthentication serverRADIUS, UDP 1812EAP over LAN (EAPoL)EAP inside RADIUSAccess-Accept, VLAN 20port opens, user placed in VLAN 20until then: only EAPoL passes802.1X keeps a port closed until the device proves who it is, and the RADIUS answer can decide where it lands.The switch relays the login between device and server without understanding it. EAP-TLS uses a certificate on each device;PEAP wraps a password. Network access control (NAC) adds posture checks, such as patches and antivirus, and can send failingor unknown devices to a quarantine or guest VLAN. Devices without a supplicant, like printers, fall back to MAC authentication.

802.1X has a supplicant, an authenticator and a RADIUS authentication server; the answer can place the user in a VLAN.

Access control · Going deeper

AAA with RADIUS and TACACS+

RADIUSTACACS+TransportUDP 1812, 1813 (accounting)TCP 49Encryptsthe password onlythe whole bodyAAAauthentication and authorisation togethereach A separatelyCommand authorisationnoyes, per commandTypical usenetwork access: Wi-Fi, VPN, 802.1Xadmin logins to routers and switchesStandardopen (RFC 2865)Cisco, now RFC 8907Authenticationwho are you?Authorisationwhat may you do?Accountingwhat did you do?AAA asks who you are, what you may do and what you did; RADIUS serves users, TACACS+ serves administrators.Both centralise logins so an account is disabled once, everywhere. Keep a local account as a fallback if the server is down.Strong authentication adds a second factor (MFA): something you know, have or are. SSO, SAML and LDAP connect it to a directory.

AAA: authentication, authorisation, accounting. RADIUS (UDP 1812) serves network access; TACACS+ (TCP 49) serves device administration.

Layer 2 security

Switch features stop attacks that start inside the LAN

Access switchDHCP serveruplink: trustedOffers allowedRogue DHCPaccess port: untrustedOffer dropped by DHCP snoopingMAC address      IP address   VLAN  Port0011.2233.4401  10.1.20.101  20    Gi1/0/5snooping binding table, learned from real leasesAttackerARP: 10.1.20.1 is at my MACDAI: not in the table, dropped ✗Switch features stop attacks that start inside the LAN: rogue DHCP servers, ARP spoofing and MAC flooding.DHCP snooping lets server messages in only on trusted ports and records each lease. Dynamic ARP inspection checks ARP repliesagainst those records. Port security limits the MAC addresses on a port; storm control caps broadcast floods; RA guard blocksrogue IPv6 router advertisements; BPDU guard shuts an access port that hears a switch.

DHCP snooping drops rogue offers on untrusted ports and builds a binding table; dynamic ARP inspection uses it to drop forged ARP.

Layer 2 security · Going deeper

Port security

Violation modeDrops the framesLogs and countsPort stateprotectyesnostays uprestrictyesyesstays upshutdown (default)yesyeserr-disabledSW1(config-if)# switchport mode accessSW1(config-if)# switchport port-securitySW1(config-if)# switchport port-security maximum 2SW1(config-if)# switchport port-security mac-address stickySW1(config-if)# switchport port-security violation restrictSW1# show port-security interface gi1/0/5Port security limits how many MAC addresses a port accepts, and the violation mode decides what happens to the rest.The default maximum is 1 and the default action shuts the port into err-disabled, recovered by shutdown and no shutdown or byerrdisable recovery. Sticky learning saves the learned addresses into the running configuration.

Port security limits MAC addresses per port; violation modes are protect, restrict and shutdown, which err-disables the port.

Threats

Each common attack has a matching defence

AttackWhat it doesDefenceDDoSfloods a target from many machinesupstream scrubbing, rate limits, CDNOn-path (ARP spoofing)sits between victim and gatewayDAI, encryption everywhereDNS poisoningforged answers send users elsewhereDNSSEC, trusted resolversVLAN hoppingdouble tags or a negotiated trunkdisable DTP, unused native VLANMAC floodingfills the MAC table so frames floodport securityRogue DHCP or AP, evil twinfake server or network nameDHCP snooping, WIPS, 802.1XPhishing, social engineeringtricks people into handing over accesstraining, MFAMalware, ransomwarecode that spreads or encrypts datapatching, segmentation, backupsEach common attack has a matching defence, and most defences live in the network you already run.Security aims at confidentiality, integrity and availability (the CIA triad). Defence in depth layers controls so one failure isnot fatal: physical locks and cameras, hardened devices with unused ports shut and default passwords changed, segmentation,encryption, monitoring and trained people.

Know the attacks: DDoS, on-path, DNS poisoning, VLAN hopping, MAC flooding, rogue DHCP and APs, phishing, malware, and their defences.

Threats · Going deeper

Zero trust

Perimeter modelinside the wall = trustedone stolen login reaches everythingZero trustuser + devicepolicy engineapp Aapp Bidentity, device health, contextZero trust checks every request on identity and device, wherever it comes from, and grants only what is needed.Location on the network no longer earns trust. Each access is authenticated, authorised and encrypted; micro-segmentation letseach workload talk only to what it needs; least privilege limits every account. A breach then stays small instead of spreading.

Zero trust verifies identity and device on every request, applies least privilege and micro-segmentation, and trusts no network location.

Lesson complete

You finished “Network security”

Nicely done.

Open in a new tab