How to Segment a Network with VLANs for Security

Learn how to segment a network with VLANs for security, from trust-tier planning and ACL enforcement to private VLANs, validation and monitoring.

Most flat networks only get segmented after something goes wrong. One infected laptop spreads across the office within an afternoon, and suddenly everyone wants a VLAN plan. Our team has seen this pattern more than once. The far better approach is to design how to segment a network with VLANs before an incident forces the issue. This guide walks through that process and explains the reasoning behind each decision, so you can adapt it to your own environment.

Why VLANs Alone Won’t Stop an Attacker

A VLAN, short for virtual LAN, splits one physical switch into several separate broadcast domains. Put guests in one VLAN and servers in another, and a broadcast from the guest wireless network never reaches the server subnet. That is useful, but it is not a security boundary on its own.

The trouble starts when those VLANs can route to each other without restriction. An attacker who lands in the guest VLAN can then walk straight into the server VLAN. In our lab testing, a default router configuration with no inter-VLAN filtering allowed full reachability between every segment. At that point the VLANs were little more than labels on a diagram.

Think of VLANs as the walls and ACLs and firewalls as the doors. Without the doors, the walls only slow an attacker down. Everything that follows is about building both.

Start from trust rather than port counts. Teams that begin by asking how many ports they have end up with VLANs that mirror the floor plan but say nothing about risk. A better question is which devices could be compromised without losing control of something important.

Build a Segment Plan by Trust Level

Before you touch any switch, sort your assets into trust tiers. We usually work with five: untrusted devices such as guest Wi-Fi, IoT and contractor laptops; user endpoints; servers; management infrastructure; and security tooling. The names matter less than the discipline behind them. Each tier needs a clear reason to exist and an explicit rule for what it may talk to.

Untrusted devices should be treated as already hostile, so they get internet access and nothing more. User endpoints need file shares and a handful of internal applications. Servers are what attackers are after, so inbound access to them should be restricted hard. Management covers switches, routers, hypervisors and out-of-band consoles, and it should be nearly unreachable from anywhere else. Security tooling such as SIEM collectors and scanners needs to see traffic, but users should never reach it directly.

Every tier gets its own VLAN and subnet, along with a named owner and a one-line purpose written down. An unowned VLAN is one nobody fixes when it breaks and nobody questions when it grows.

Keep management isolated from every data VLAN. This is the rule we see broken most often. Someone places a hypervisor management address on the server subnet “just for now,” and two years later that subnet is the easiest route to full control of the environment.

Design the Addressing and VLAN Map

A predictable numbering scheme saves hours of confusion later. We favour a pattern where both the VLAN ID and the third octet of the subnet follow the tier: 10x for users, 20x for servers, 30x for IoT, and 99 for management. Someone glancing at 10.20.30.5 can recognise a server without opening a spreadsheet.

Allocate subnets with room to grow. A /24 per VLAN is a common starting point for small offices, but leave unused blocks between tiers so one can expand without renumbering the others. Where the routing design allows, summarise routes per tier so the core routing table stays small and readable.

Record the entire map in version control. That can feel bureaucratic until the day someone asks why a VLAN exists and the answer sits in a commit message from three years earlier. Each change then becomes a reviewable diff instead of something remembered by one person. If you are still deciding on the wider architecture, our notes on SD-WAN and fiber backbone resilience cover how segment design interacts with the transport layer.

Configure VLANs and Trunks Safely

The following is a minimal example in Cisco-style syntax. Commands differ between vendors and software versions, so verify against your platform documentation before anything reaches production.

First, create the VLANs and give them names so the labels appear in every show command:

vlan 100
 name USERS
vlan 200
 name SERVERS
vlan 300
 name IOT
vlan 999
 name PARKING

Next, place access ports into a single VLAN and limit trunks so only the VLANs they actually need cross them:

interface GigabitEthernet1/0/10
 switchport mode access
 switchport access vlan 100
 spanning-tree portfast
!
interface GigabitEthernet1/0/48
 switchport mode trunk
 switchport trunk allowed vlan 100,200
 switchport trunk native vlan 998

The allowed-VLAN list on a trunk matters more than most people expect. A trunk that carries every VLAN to every switch is simply a flat network with extra steps.

Shut down unused ports and move them into the parking VLAN. A port sitting in VLAN 999 with no gateway is a dead end for anyone who plugs something in. Set the native VLAN on trunks to an unused ID rather than leaving it at VLAN 1. Port security or 802.1X can add another layer where your hardware supports it, but feature sets and limits depend on the platform and software release, so confirm them before relying on either.

Enforce Inter-VLAN Traffic with ACLs

Once the VLANs exist, traffic between them has to pass through a Layer 3 gateway, and that is where policy is enforced. The principle is default-deny: each tier may reach only the specific services the business requires.

The example below allows user VLAN 100 to reach a file server on TCP 445 and an internal web application on 443, while blocking everything else destined for the server VLAN:

ip access-list extended USERS_TO_SERVERS
 permit tcp 10.1.0.0 0.0.0.255 host 10.2.0.10 eq 445
 permit tcp 10.1.0.0 0.0.0.255 host 10.2.0.20 eq 443
 deny ip any any log
!
interface Vlan200
 ip access-group USERS_TO_SERVERS in

The ACL is applied inbound on the server VLAN interface, which filters traffic arriving from users. Confirm the direction every time you apply one, because getting it backwards is a frequent reason a rule appears to do nothing.

Logging denies on sensitive segments is worthwhile, but volume needs care. On a busy gateway, logging every denied packet can load the CPU and bury the one event that matters. Rate-limit logging where the platform allows it, and review hit counts regularly rather than reading every line.

Use Private VLANs for Host-to-Host Isolation

Separate VLANs and subnets handle different tiers. They do not handle hosts that share a subnet yet should never communicate with each other. Guest Wi-Fi is the classic case, since two visitors on the same subnet have no reason to talk directly. Shared hosting and a DMZ web tier present the same problem.

Private VLANs address this inside a single subnet. There are three port types. A promiscuous port reaches everything and usually faces the gateway. An isolated port can talk only to promiscuous ports, so hosts cannot reach one another. A community port can talk to other ports in its own community and to promiscuous ports, which suits small groups that should see each other but nobody else.

The caveat is real: support and exact behaviour vary by vendor and model. Some platforms handle private VLANs cleanly, while others restrict routing or limit which ports may be promiscuous. Read the documentation for your specific switch and test in a lab before designing around the feature.

How the Segmentation Mechanisms Differ

These mechanisms are often confused, so it helps to see how they differ in practice. A VLAN defines a broadcast domain and is enforced at the switch port, but it does not filter routed traffic by itself. An inter-VLAN ACL governs traffic between subnets at the Layer 3 gateway and is only as good as the rules written into it. A private VLAN isolates hosts within one subnet at the switch, with behaviour that depends on the platform. A firewall zone controls stateful flows between zones and needs a clear zone design to stay useful. Microsegmentation applies policy to individual workloads through a host or hypervisor agent, which is more demanding to operate and audit.

A VLAN does not stop an attacker who is already inside it. An ACL does not stop lateral movement within a flow it permits. Private VLANs are not a substitute for inspection by a firewall. Understanding what each control leaves open matters, because those gaps are usually where the next incident begins.

Some threats pass through all of these controls. ARP spoofing within a VLAN still works unless Dynamic ARP Inspection and DHCP snooping are enabled for that VLAN. Malware that abuses an allowed port, such as HTTPS on 443 to a permitted web application, will pass an ACL without difficulty. These risks need their own controls, and they connect directly to broader work on cybersecurity and zero trust verification.

Mistakes That Quietly Undo Your Segmentation

In our experience the failures are rarely exotic. They are small shortcuts that stay in place for years. Trunking every VLAN to every port is the most common, since it keeps the network working during the project and leaves it wide open afterwards. Leaving VLAN 1 in active use comes close behind, because it is the default for untagged traffic and many devices end up there by accident.

Temporary any-any rules between tiers come second. Someone opens a path to debug a problem, the problem gets solved, and the rule remains for four years. Every temporary rule should carry an expiry date and an owner, and it should be reviewed on a schedule.

Dual-homed servers quietly bridge segments. A server with one interface in the server VLAN and another in the user VLAN creates a route that bypasses the gateway entirely. These rarely appear in diagrams, so look for them during the design review. Finally, mixing management and user traffic on the same uplink cancels the isolation you built. Give management its own path, even if that is only a dedicated VLAN on a shared link with strict controls.

Validate and Monitor the Segments

A segmentation design is only a hypothesis until it is tested. From a host in the untrusted tier, attempt to reach a server, a management address and a security tool. Use ping and traceroute to confirm reachability, and targeted port checks for the services that should be blocked. Verify that the denies show up in your logs. If a test that should fail succeeds, you have found a real gap, and that is exactly what the exercise is for.

Repeat the same tests after every change and keep the results as evidence. Auditors ask for this, and so does your future self when a change breaks something unexpectedly. Track ACL hit counts as well, and alert on cross-tier flows that appear without explanation. A rule that suddenly matches thousands of packets deserves investigation, even when the traffic is technically permitted. For teams that want to go further, our write-ups on threat hunting with eBPF and kernel observability show how deeper telemetry can confirm what the ACL logs suggest.

Rollout Planning for a Typical Office

For an office of roughly 100 users, a rollout usually follows a predictable path. Begin by inventorying the switches and devices, then pilot a single tier in a test area, and finally cut over the remaining tiers during a maintenance window. Avoid moving everything at once. The pilot surfaces the mistakes you would otherwise discover at nine on a Monday morning.

The main drivers of effort are the number of switches that need access or trunk changes, the maturity of your firmware and whether the features you need are stable on that release, the team’s familiarity with the platform and the VLAN design, and the availability of a change window the business will accept. Costs vary considerably with vendor, hardware generation and local labour rates, so we avoid quoting a single figure. Build your estimate from your own inventory, and collect at least two quotes for any hardware you do not already own.

If you need outside help with the architecture or the rollout, look for engineering partners with demonstrable, lab-tested experience. A team that offers dịch vụ SEO của MONA Media is a marketing provider and is not the right fit for network segmentation work, so keep your evaluation focused on infrastructure specialists.

Frequently Asked Questions

Do I still need a firewall if I already use VLANs?

Usually yes, at least at the internet edge. VLANs separate broadcast domains but do not inspect traffic or track sessions. A firewall provides stateful filtering, application-aware logging and the ability to inspect what is allowed through. Without one, your ACLs are being asked to do a job they were never designed for.

Is it really a problem to keep VLAN 1 in use?

It is not dangerous in itself, but it is a poor default to leave active. Untagged traffic and many management protocols land there automatically, which makes it predictable for attackers and a source of accidental mixing. Move user and management traffic onto explicitly numbered VLANs, and assign the native VLAN an unused ID.

Can private VLANs replace separate subnets?

Only for hosts that should be isolated from one another inside a single subnet. Private VLANs do not replace separate subnets for different trust tiers, because they do not provide routed policy between tiers. Use them alongside subnets, and confirm that your platform supports the exact behaviour you need.

How many VLANs is too many for a small office?

There is no fixed number, but a small office rarely needs more than five or six. Each VLAN should correspond to a real trust tier with an owner and a stated purpose. If you cannot name the owner of a VLAN, you probably have one too many.

Does segmentation replace zero trust?

No. Segmentation limits where an attacker can move, which is valuable, but zero trust asks you to verify every request regardless of network location. The two work together: segmentation reduces the blast radius, and zero trust controls decide who may cross each boundary in the first place.

Related topics