Skip to content
Back to Series Network Security from Scratch
Networking

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.

A
Alif Afriza Author
· · 4 min read
VLAN and Network Segmentation for Security

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:

  1. All devices can “see” each other.
  2. Malware that enters one device can spread to other devices easily.
  3. A large flat network makes ARP spoofing and man-in-the-middle attacks easier.
  4. 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?

ProblemSolution with VLAN
Malware spreads to all devicesContained within one VLAN
Guests can peer into the internal networkGuests are separated into a guest VLAN, with no access to the internal network
CCTV cameras can be accessed by anyoneCCTV is on its own VLAN, with rules allowing only the NVR and admin
Print server is visible to everyonePrinter 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:

VLANUsePolicy
10Internal (work computers)Can access servers and the internet
20ServerOnly required ports
30CCTVOnly to NVR and admin monitor
40Guest WiFiInternet 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

  1. 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.
  2. Turn off all unused ports or move them to a dead VLAN, so an attacker cannot plug in a cable and enter the network.
  3. 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.
  4. 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.
Open for Contributors

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.

Discussion & Comments