DMZ & Network Segmentation
π Concept Note β CSF & NS Unit III Deep Dive | Source: MCA Sem III Syllabus
The Problem It Solves
A perimeter firewall protects the boundary β but once an attacker is inside, a flat network lets them reach everything. Segmentation answers the question: βassuming they get in, how far can they get?β
It is the practical implementation of assume breach (Zero Trust Architecture) and the main control against lateral movement.
βοΈ How It Actually Works
The core insight: north-south vs east-west traffic
Internet
β
β NORTH-SOUTH (in/out of the network)
β β firewalls inspect this well
ββββββββββΌβββββββββ
β Firewall β
ββββββββββ¬βββββββββ
β
βββββββββββ¬ββββββββ΄ββββββββ¬ββββββββββ
β β β β
[Server A]β[Server B]ββββ[Server C]β[Workstation]
βββββββββββ΄ββββββββββββββββ΄ββββββββββ
EAST-WEST (server to server, inside)
β a perimeter firewall NEVER SEES THIS
Perimeter firewalls inspect north-south traffic. Traffic between internal hosts (east-west) never crosses the firewall, so it is completely uninspected. That is exactly the traffic an attacker uses after landing on one machine. Segmentation forces east-west traffic through a control point.
Lateral movement β what segmentation actually stops
- Attacker phishes one workstation β gets a foothold.
- Scans the local subnet β on a flat network they see file servers, databases, domain controllers, printers, everything.
- Reuses stolen credentials / exploits an unpatched internal box β moves to it.
- Repeats until they reach the domain controller or the database.
The initial compromise is rarely the valuable machine. The breach happens during step 2β4. Segmentation breaks the chain: the attacker on the user VLAN simply cannot reach the database VLAN, because a firewall/ACL between them denies it.
Flat vs Segmented Networks
| Flat network | Segmented network | |
|---|---|---|
| Layout | Everything in one broadcast domain | Split into zones by function/sensitivity |
| Blast radius | Entire network | One zone |
| Internal traffic control | None | Firewall/ACL between zones |
| Broadcast noise | High | Contained |
| Compliance | Fails (e.g. PCI-DSS) | Scopes audit to the card zone only |
Typical zones: User workstations Β· Servers Β· Databases Β· DMZ Β· Management Β· Guest Wi-Fi Β· IoT/OT.
π‘ Practical rule: put the guest Wi-Fi and IoT devices on their own isolated segment with internet-only access. A compromised smart TV or camera then cannot touch your servers β this is the single most common real-world win.
The DMZ (Demilitarised Zone)
A DMZ is a separate network zone for services that must be reachable from the Internet β web, mail, DNS, public API.
The dilemma it resolves: a public web server must accept connections from anyone, which makes it the most likely thing to be compromised. If it sits on the internal LAN, compromising it hands the attacker your LAN. If you disconnect it, it canβt serve anyone.
The DMZ answer: put it in a third zone that is reachable from the Internet but whose access into the internal LAN is tightly restricted. When (not if) it is compromised, the attacker is stuck in a low-value zone.
Single-firewall (three-legged) DMZ
Internet
β
βββββββΌββββββ
β Firewall β (3 interfaces)
ββββ¬ββββββ¬βββ
β β
ββββββββββΌββ βββΌβββββββββββ
β DMZ β β Internal β
β Web/Mail β β LAN β
ββββββββββββ ββββββββββββββ
One firewall, three interfaces (Internet / DMZ / LAN). Cheaper and simpler β but it is a single point of failure, and one misconfiguration or firewall compromise exposes everything.
Dual-firewall (screened subnet) DMZ β more secure
Internet βββΊ [ External Firewall ] βββΊ DMZ βββΊ [ Internal Firewall ] βββΊ LAN
permissive-ish strict, deny most
Two firewalls, ideally from different vendors β a zero-day in one vendorβs product doesnβt breach both. The external firewall is relatively permissive (it must allow 80/443 in); the internal one is strict.
The rules that make a DMZ a DMZ
| From | To | Allowed? |
|---|---|---|
| Internet | DMZ | β Yes (80/443 only) |
| DMZ | Internet | β οΈ Limited (updates only) |
| DMZ | Internal LAN | π« Denied by default β the critical rule |
| Internal LAN | DMZ | β Yes (admin/management) |
| Internet | Internal LAN | π« Never directly |
If the web server needs a database, the database stays on the internal side, and you allow only the DMZ web server to reach only the DB server on only the DB port β never a general DMZβLAN allow.
VLANs β how segmentation is actually implemented
A VLAN splits one physical switch into multiple isolated logical networks. Two devices on the same switch but different VLANs cannot talk directly at Layer 2, as if they were on separate switches.
802.1Q tagging β the mechanism:
- A 4-byte VLAN tag (containing a 12-bit VLAN ID, so 1β4094) is inserted into the Ethernet frame header.
- Access port β connects to an end device (a PC). Traffic is untagged; the switch assigns the portβs VLAN internally.
- Trunk port β connects switch-to-switch or switch-to-router. Carries many VLANs, so frames are tagged to identify which VLAN each belongs to.
PC (VLAN 10) ββaccess(untagged)βββΊ Switch A ββtrunk(tagged)βββΊ Switch B ββaccessβββΊ PC (VLAN 10)
carries VLANs 10,20,30
Inter-VLAN routing: VLANs are separate Layer 2 domains, so traffic between them needs a Layer 3 device (router or L3 switch) β which is precisely where you apply ACLs/firewall rules. That routing chokepoint is what turns a VLAN into a security control.
β οΈ A VLAN by itself is not security β itβs separation. Without ACLs on the inter-VLAN routing, all VLANs can still reach each other; youβve only reduced broadcast traffic.
VLAN hopping (the attack)
- Switch spoofing β attackerβs machine pretends to be a switch and negotiates a trunk (via DTP), gaining access to all VLANs. Fix: disable DTP/auto-trunking; set access ports to
switchport mode accessexplicitly. - Double tagging β attacker sends a frame with two VLAN tags; the first switch strips the outer tag and forwards it into the victim VLAN. Fix: never use the native VLAN for user data; change it from the default VLAN 1.
Micro-Segmentation
VLANs segment by network zone. Micro-segmentation goes to the individual workload: each VM/container/app gets its own policy, enforced at the host or hypervisor rather than at a network chokepoint.
- Policies follow the workload wherever it moves (essential in cloud/virtualised estates).
- Enforced by identity/tags (βweb tier may talk to app tier on 8080β) not IP subnets.
- Enables default-deny east-west β the practical realisation of Zero Trust Architecture at the network layer.
| VLAN segmentation | Micro-segmentation | |
|---|---|---|
| Granularity | Subnet/zone | Single workload |
| Enforced at | Router/firewall | Hypervisor/host agent |
| Follows workload | β | β |
| East-west default | Usually allowed within zone | Default deny |
β οΈ Gotchas / Exam Traps
- βWhy not put the web server on the LAN?β β because it is Internet-exposed and therefore most likely to be compromised; on the LAN, its compromise = LAN compromise. The DMZ contains the blast radius.
- Segmentation limits lateral movement; it does not prevent the initial compromise.
- VLAN β security without inter-VLAN ACLs.
- A DMZ with a general DMZ β internal LAN allow rule defeats the entire purpose.
- Flat networks fail compliance regimes (PCI-DSS) because audit scope becomes the whole network.
πΊ Learn by Video
Supplementary only β these help you visualise. The technical content above is written independently and stands on its own.
- βΆοΈ βVLAN Explainedβ β https://www.youtube.com/watch?v=jC6MJTh9fRE
- βΆοΈ βVLANs, Tagging, Trunking, VxLAN, & Native VLANβ (the 802.1Q detail) β https://www.youtube.com/watch?v=MNZa-S4E-To
- π DMZ / screened subnet β search
Related Concepts
- Network Defence Mechanisms β Unit III hub
- Firewalls β enforces the rules between zones
- Zero Trust Architecture β micro-segmentation is Zero Trust at network level
- OSI Model & TCP-IP Security β L2 vs L3 boundaries
- Networking Fundamentals β switches, broadcast domains, subnets