#Why this matters
In earlier lessons on network attacks and scanning, you saw how easily an attacker on a shared broadcast domain can run ARP spoofing, sniff unencrypted traffic, or sweep adjacent hosts with Nmap. On a flat network, compromising a single workstation or printer gives an intruder direct Layer 2 and Layer 3 reachability to domain controllers, backups, and databases.
Segmentation breaks a large target into small, firewalled compartments. Even if one host is compromised, strict zone boundaries, workload policies, and port admission controls contain the blast radius and give defenders time to detect and evict the threat.
#Macro-segmentation: VLANs and DMZs
VLANs (IEEE 802.1Q) divide a physical switch fabric into separate Layer 2 broadcast domains. Separating workstations, printers, and servers into distinct VLANs stops broadcast-based attacks such as ARP spoofing from crossing between groups. However, VLANs alone do not enforce policy once packets reach a Layer 3 router: you must pair each VLAN subnet with stateful firewall rules (forward chain policies) to control inter-VLAN traffic.
Public-facing services such as web portals, mail relays, or reverse proxies belong in a DMZ (demilitarized zone, or screened subnet). The perimeter firewall permits inbound HTTPS (443/tcp) from the internet to the DMZ, while an internal firewall policy permits the DMZ proxy to reach only the specific backend port it needs (such as 5432/tcp to a database tier). The database tier never accepts direct internet connections and cannot initiate outbound connections to the internet.
- Internetuntrusted external clients
- Perimeter Firewallallow 443/tcp to DMZ only
- DMZ (10.20.10.0/24)reverse proxy and web frontend
- Internal Firewallallow 5432/tcp from proxy IP only
- Internal DB (10.20.20.0/24)isolated data tier, no internet egress
#Microsegmentation and east-west control
Traditional perimeter firewalls inspect north-south traffic (entering or leaving the data centre), leaving east-west traffic (server to server inside the same VLAN) completely unfiltered. If two application servers share a subnet, a compromise on one lets an attacker pivot directly to the other over SMB, SSH, or internal APIs.
Microsegmentation moves enforcement down to individual workloads using host firewalls (nftables), hypervisor virtual switches, or container NetworkPolicy objects. Even inside the same subnet, a web server can be blocked from initiating SSH or SMB connections to neighbouring web servers.
| Control layer | Scope | Typical mechanism | Primary threat mitigated |
|---|---|---|---|
| VLANs and Routing ACLs | Subnet / zone | 802.1Q + stateful router/firewall | Broadcast spoofing, north-south exposure |
| DMZ | Public edge services | Screened subnet between firewalls | Direct internet reachability to internal DBs |
| Microsegmentation | Individual host or pod | Host nftables, Kubernetes NetworkPolicy |
East-west lateral movement inside a zone |
| NAC (802.1X) | Physical port or SSID | RADIUS + EAP-TLS + dynamic VLAN | Rogue devices plugging into wall jacks |
On a Linux segmentation gateway, an nftables forward chain expresses zone-to-zone policies cleanly using interface or subnet bindings:
table inet seg_filter {
chain forward {
type filter hook forward priority filter; policy drop;
ct state established,related accept
# Internet to DMZ reverse proxy (10.20.10.10) on HTTPS
iifname "eth0" ip daddr 10.20.10.10 tcp dport 443 ct state new accept
# DMZ reverse proxy to internal DB (10.20.20.50) on PostgreSQL only
iifname "vlan10" ip saddr 10.20.10.10 ip daddr 10.20.20.50 tcp dport 5432 ct state new accept
}
}Notice what is omitted: vlan10 (DMZ) cannot reach the corporate user VLAN, and eth0 (internet) cannot reach 10.20.20.50 directly.
#Network Access Control (NAC) with IEEE 802.1X
Network segmentation fails if anyone can plug an unauthorised laptop into an office wall jack and land directly on an internal VLAN. IEEE 802.1X provides port-based Network Access Control across wired Ethernet switches and enterprise Wi-Fi.
Before authentication succeeds, the switch port blocks all IP traffic and forwards only EAPoL (EAP over LAN) frames to the RADIUS server. Using EAP-TLS (mutual X.509 certificates on both client and server) proves device identity cryptographically and assigns the port dynamically to the right VLAN (corporate, IoT, or restricted guest/remediation).
#Moving toward Zero Trust Architecture
Classic perimeter models assumed that anything inside the corporate LAN or VPN was trustworthy ("castle-and-moat"). Zero Trust Architecture (defined in NIST SP 800-207) removes implicit trust based on network location. Whether a request comes from a campus desk or a remote laptop, access is granted per session only after verifying user identity, device health posture, and least-privilege resource scope, with encryption (such as TLS 1.3 or mutual TLS) between services.
Segmentation and Zero Trust reinforce each other: network segmentation shrinks the blast radius at Layers 2 and 3, while identity-aware proxies and workload mTLS verify every application request at Layer 7.
#Common mistakes
- Using VLANs without inter-VLAN firewalling: Routing between VLANs without stateful
forwardACLs leaves every subnet reachable from every other subnet. - Placing databases in the DMZ: Hosting both the public web server and the database in the same DMZ subnet exposes stored records if the web app is breached.
- Relying on MAC address allow-lists for NAC: Static MAC filtering is bypassed in seconds by changing a network interface's MAC address; use 802.1X EAP-TLS instead.
- Ignoring east-west traffic: Allowing unrestricted communication among servers in the same VLAN lets attackers pivot laterally without crossing the perimeter firewall.
- Exposing management interfaces to user VLANs: Switch SSH/HTTPS management and hypervisor consoles must reside in a dedicated management VLAN reachable only via authenticated jump hosts.
#Summary
- Macro-segmentation separates broadcast domains with 802.1Q VLANs and enforces stateful inter-zone policies at routers and firewalls.
- A screened DMZ isolates public-facing services from internal databases so external traffic never reaches sensitive data tiers directly.
- Microsegmentation controls east-west traffic between hosts inside the same subnet using host firewalls or workload policies.
- IEEE 802.1X with EAP-TLS authenticates endpoints before opening switch ports, supporting Zero Trust principles where network location never grants implicit trust.