VLAN and Network Segmentation for Security
Why splitting a network with VLANs forms a security foundation: how VLANs work, access practices, broadcast scope, and segment-by-segment examples.
If the CIA Triad is a security philosophy, network segmentation is its physical manifestation. Splitting a large network into smaller parts is one of the most effective and cheapest steps to limit damage when an attack occurs.
Why Is One Large Network Dangerous?
If all devices are on one network (one subnet), the result is:
- All devices can “see” each other.
- Malware that enters one device can spread to other devices easily.
- A large flat network makes ARP spoofing and man-in-the-middle attacks easier.
- The broadcast domain becomes very large, and traffic is unpredictable and chaotic.
A small principle with a big impact: narrow the reach. If an attacker can only touch devices in one small segment, the damage stops there.
What Is a VLAN?
VLAN (Virtual Local Area Network) makes one physical switch behave like several separate switches. Devices on different VLANs behave as if they are on different networks, even though they are connected to the same switch.
[Single physical switch]
VLAN 10 -> employees
VLAN 20 -> servers
VLAN 30 -> CCTV
VLAN 40 -> guest
Devices on VLAN 10 cannot directly contact devices on VLAN 30 without going through a router (or layer 3). This is the point where security rules (firewall) can intervene.
Why Does VLAN = Security?
| Problem | Solution with VLAN |
|---|---|
| Malware spreads to all devices | Contained within one VLAN |
| Guests can peer into the internal network | Guests are separated into a guest VLAN, with no access to the internal network |
| CCTV cameras can be accessed by anyone | CCTV is on its own VLAN, with rules allowing only the NVR and admin |
| Print server is visible to everyone | Printer is on a dedicated VLAN, and only those who need to can print |
Important to remember: A VLAN is not a firewall. VLANs isolate traffic, but the decision “who may pass between VLANs” is still made at the router/firewall (inter-VLAN routing). Separation without firewall rules between VLANs is cosmetic isolation.
Example of a Small Segmentation Design
For a more serious office or homelab:
| VLAN | Use | Policy |
|---|---|---|
| 10 | Internal (work computers) | Can access servers and the internet |
| 20 | Server | Only required ports |
| 30 | CCTV | Only to NVR and admin monitor |
| 40 | Guest WiFi | Internet only, forbidden from entering all other VLANs |
The inter-VLAN firewall rules in question: for example, “VLAN 40 (guest) may go out to the internet but is forbidden from entering 10, 20, 30”. This is what distinguishes secure segmentation from mere technical separation.
Practices That Are Often Forgotten
- Do not put all devices on the default VLAN. Make unknown devices join a specific VLAN, because the default VLAN is often the least guarded.
- Turn off all unused ports or move them to a dead VLAN, so an attacker cannot plug in a cable and enter the network.
- Trunk only to devices that need it. Trunk ports (which carry many VLANs) forward many networks; leaving them open to any device is a vulnerability.
- Do not trust VLAN tags from untrusted devices. VLAN hopping is an attacker technique to masquerade into another VLAN using fake tags (double tagging). Enable switch hardening practices.
Viewing VLANs on a Switch
On managed switches (for example, Cisco and Mikrotik syntax are similar), common commands:
# Common Cisco IOS
show vlan brief
show interfaces trunk
# Add VLAN
vlan 40
name GUEST
For beginners, it is better to start with a router/switch that already has a GUI (for example, Mikrotik, Ubiquiti, or OpenWrt on a router), so you can experiment without fear of getting a CLI command wrong.
Curriculum continuation: after the network is divided, monitor movement within it with IDS and IPS for intrusion detection and prevention.
References
- IEEE 802.1Q-2022, Bridges and Bridged Networks (VLAN and tagging standard), standards.ieee.org/ieee/802.1Q/.
- NIST SP 800-41 Rev 1, Guidelines on Firewalls and Firewall Policy, csrc.nist.gov/pubs/sp/800/41/r1/final (rules between segments).
- James Kurose and Keith Ross, Computer Networking: A Top-Down Approach, Pearson (LAN and segmentation chapter).
- Cisco, VLAN and Trunking Configuration Guide, documentation.cisco.com.
- Steven Jiang, VLAN Security: Understanding VLAN Hopping, book/article about VLAN tag exploitation.
Related Articles
WiFi Security: WPA2, WPA3, 802.1X, and Rogue AP
Secure wireless networks: strengths and weaknesses of WPA2 through WPA3, enterprise 802.1X, how to detect rogue access points, and safe home WiFi practices.
NetworkingUnderstanding Enterprise Networks: Infrastructure and Security in Large Buildings
How computer networks work in large buildings or enterprise offices, from structured cabling and layered switches to invisible network security.
NetworkingHomelab Network Topology: From Zero to Advanced Network
A complete guide to building a homelab network topology from scratch, from basic setup to VLANs, MikroTik, and RT/RW Net.
Your ideas deserve to be read by thousands of people.
ByteNesia is built for everyone. If you have experience, tutorials, or opinions about technology, write and share them here. Your name will be credited as a contributor.
Write anything: tool reviews, homelab tutorials, security tips, or your tech stories.