Skip to content
Microsegmentation.si

Microsegmentation implementation

VLAN Segmentation: How It Works, VLAN vs Subnet and How to Secure It

How VLANs segment a network, where their limits are and how CISA says to harden them.

Jorge HorstUpdated Based on public sources, not lab tested

VLAN segmentation divides one physical network into smaller logical networks, each its own broadcast domain, so traffic stays separate without separate switches. It’s a common and cost-effective first step. On its own it isn’t a security boundary: you still need a firewall or ACLs between VLANs, and switches need hardening against VLAN attacks.

How does VLAN segmentation work?

VLAN segmentation works by assigning switch ports, or tagged traffic, to separate logical networks. If you need the basics first, see what a VLAN is. CISA describes each VLAN as a single broadcast domain that isolates traffic from other VLANs. NIST SP 800-82 gives a simple example: on an 8-port switch, ports 1 to 4 can belong to one VLAN and ports 5 to 8 to another.

  • Logical separation: Cisco’s guide says that VLANs group devices by function, team or application, regardless of location.
  • Standard: VLAN tagging is defined in IEEE 802.1Q, with a 12-bit ID that allows a theoretical maximum of 4,094 VLANs.
  • When to use it: NIST describes VLANs as a way to separate areas when physical separation isn’t feasible.

What is the difference between a VLAN and a subnet?

A VLAN separates traffic at the switching layer, while a subnet is a range of IP addresses. No single standard we read defines the comparison, so the table below is our summary of CISA, NIST and Cisco statements.

ItemVLANSubnet
LayerLayer 2, the Ethernet layerLayer 3, IP addressing
DefinesA broadcast domain on switchesA range of addresses
Configured onSwitchesHosts, routers and firewalls
Crossing it needsA layer 3 deviceA router or firewall

The two are often paired. Cisco says that VLANs are often associated with IP subnets, and CISA recommends a one-to-one relationship between them. But it’s not a strict rule: members of a private VLAN, for example, share one subnet.

How do you control traffic between VLANs?

You control traffic between VLANs by routing it through a device that can enforce rules. Traffic has to be routed to leave a VLAN, and in our view the routing only connects the VLANs: the restriction comes from what you apply on that path.

CISA, the NSA, the FBI and partners describe strong segmentation using router ACLs, stateful packet inspection, firewall capabilities and DMZ constructs, with VLANs and private VLANs adding logical separation. NIST SP 800-82 says isolation devices such as gateways and firewalls should permit only explicitly authorized communication. In short, deny by default, as our network segmentation best practices explain.

The flow log policy drafter can help you find which inter-VLAN flows you actually need.

How do you stop VLAN hopping?

You stop VLAN hopping by changing switch defaults, because CISA warns that default and standard configurations aren’t inherently secure. Its 2016 practice names VLAN hopping, double tagging and switch spoofing as exploits, and notes that countermeasures generally aren’t on by default.

RiskMitigation from CISA
Switch spoofingDisable Dynamic Trunking Protocol, and set ports as static access ports
Double taggingUse an unused VLAN as the native VLAN on trunks, and keep access ports off it
VLAN 1 exposurePrune VLAN 1 where it isn’t needed, and don’t use it for in-band management
Management accessUse a dedicated management VLAN, and out-of-band access where feasible
Unused portsDisable them and assign them to an unused VLAN
Spoofing on a segmentUse port security, limit MAC addresses per port, and add layer 2 ACLs

That guidance dates from 2016 and has an industrial focus, so check it against your switch vendor’s current documents.

What are private VLANs?

Private VLANs limit communication between devices within the same VLAN. According to Cisco’s guide and RFC 5517, isolated ports can reach only promiscuous ports, which is typically where the gateway connects, and community ports can also reach their own community.

They suit devices that only need to reach a gateway, in our view, such as those covered in IoT network segmentation. The limit is that the separation applies at layer 2 only. Cisco notes that hosts can still communicate at layer 3, so you also need controls on the gateway.

When is VLAN segmentation not enough?

VLAN segmentation isn’t enough when you need control between systems in the same VLAN, or when rules grow too large to manage. NIST SP 800-215 notes that VLAN-based policies apply to subnets rather than individual hosts, and it names mapping application needs to segments and managing changes as the difficulties. CISA adds that VLANs can be misconfigured.

For finer control, see microsegmentation vs network segmentation. For the wider view, read what network segmentation is and look at network segmentation tools.

Sources

  • CISA, Recommended Practice: Improving ICS Cybersecurity with Defense-in-Depth Strategies, September 2016, section 2.4.3, pp. 21-22: cisa.gov/sites/default/files/recommended_practices/NCCIC_ICS-CERT_Defense_in_Depth_2016_S508C.pdf
  • CISA, NSA, FBI and partners, Enhanced Visibility and Hardening Guidance for Communications Infrastructure, December 2024, p. 4: cisa.gov/sites/default/files/2024-12/joint-guidance-enhanced-visibility-hardening-guide-for-comms-infrastructure-508c.pdf
  • NIST SP 800-82 Rev. 3, September 2023, section 6.2.1.3 and Appendix E.1.3: doi.org/10.6028/NIST.SP.800-82r3
  • NIST SP 800-215, November 2022, section 5.1.2: doi.org/10.6028/NIST.SP.800-215
  • IEEE 802.1Q-2022, standards page: standards.ieee.org/ieee/802.1Q/10323
  • RFC 5517, Cisco Systems’ Private VLANs, February 2010 (informational): rfc-editor.org/rfc/rfc5517.html
  • Cisco, VLAN configuration guide, Catalyst 9200, IOS XE 17.12: cisco.com/c/en/us/td/docs/switches/lan/catalyst9200/software/release/17-12/configuration_guide/vlan/b_1712_vlan_9200_cg/configuring_vlans.html
  • Cisco, private VLANs guide, Catalyst 9200, IOS XE 17.12: cisco.com/c/en/us/td/docs/switches/lan/catalyst9200/software/release/17-12/configuration_guide/vlan/b_1712_vlan_9200_cg/configuring_private_vlans.html

Frequently asked questions

What is the difference between a VLAN and a subnet?

A VLAN separates traffic at the switching layer, creating one broadcast domain. A subnet is a range of IP addresses, so it operates at the IP layer. They are commonly mapped one to one, and CISA recommends that, but they aren't the same thing.

Do VLANs provide security?

Only partly. They separate traffic, but CISA warns that default configurations aren't inherently secure. VLANs also need a firewall or ACL controlling traffic between them, plus hardening against attacks such as VLAN hopping.

Can devices in different VLANs communicate?

Only through a layer 3 device such as a router, firewall or multilayer switch. Routing alone just connects them. In our view, the protection comes from the firewall rules or ACLs that you apply on that path.

Is VLAN segmentation the same as microsegmentation?

Not usually. NIST SP 800-215 describes a VLAN-based form of microsegmentation, but notes that its policies apply to subnets rather than individual hosts. Finer designs enforce rules per workload, at the host or hypervisor.

Related articles