Network Security

What Is a VLAN? How Virtual LANs Work and When You Need One

A VLAN turns one physical network into separate groups that can't see each other unless you allow it. Here's how virtual LANs work, what they're for at home and when you need one.

Small managed network switch with blue, green and yellow patch cables on a home office shelf

Disclosure: This post may contain affiliate links. As an Amazon Associate, we earn from qualifying purchases. This comes at no extra cost to you. Ratings reflect our own editorial evaluation.

Quick Answer

A VLAN (virtual local area network) is a separate logical network created inside one physical network, so devices that share the same switches, cables and Wi-Fi can be split into isolated groups.

Devices in the same VLAN talk directly, while traffic between VLANs has to pass through a router or Layer 3 switch that decides what's allowed.

Table of Contents

A single Ethernet cable can carry traffic for up to 4,094 networks at once. That’s how many usable VLAN IDs the 802.1Q standard allows, according to TP-Link’s Omada team.

Each of those networks is a VLAN, and your router, switch and Wi-Fi can run several with no extra wire. At home, that keeps a cheap smart plug off your banking laptop’s network.

So what is a VLAN, really, and how do tags, ports and routing keep VLANs apart? Most homes need only 3 to 5 of them, so it pays to know where they help and where they fall short.

What Is a VLAN?

A VLAN (virtual local area network) is a separate network that a network switch creates in its settings.

Devices that share the same cables and Wi-Fi can then be split into groups that can’t see each other.

A VLAN is a virtual network, so nothing physical changes when you add one.

The same switch ports and the same Wi-Fi radios carry every group, and the switch simply keeps each group’s traffic in its own lane.

That’s the big idea behind the technology.

A normal home network is one flat Local Area Network (LAN): every phone, laptop, printer, smart plug and camera that connects to your router.

By default, every one of those devices can find and talk to every other one.

A VLAN draws a border inside that LAN.

Your laptop and your file server can sit on one side, while your smart TV and doorbell camera sit on the other, even when they plug into neighboring ports on the same switch.

A VLAN changes which devices can talk to each other without changing a single cable.

What Does VLAN Stand For?

VLAN stands for virtual local area network, and you’ll also see it written as virtual LAN.

The “local area network” part means the devices in one home, office or building.

The “virtual” part means it’s a virtual network whose border comes from configuration, not from separate wiring.

Router, managed switch and unmounted access point connected on a closet shelf

Router and switch menus label the feature in a few ways: VLAN, 802.1Q VLAN, tagged VLAN or simply “network.” Those all point to the same idea.

So if your router’s settings page lists networks with numbers next to them, you’re probably looking at VLANs already.

A VLAN in Simple Terms

In simple terms, a VLAN is a group of devices that your network treats as if they had their own private switch.

Picture an apartment building where every tenant uses the same hallways and elevators, but each key only opens one apartment.

The building is your physical network, and each apartment is a VLAN.

Here’s why that matters:

Without VLANs, a cheap smart plug with buggy firmware sits on the same network as the laptop you do your banking on.

With VLANs, that plug can reach the internet but can’t knock on your laptop’s door.

That’s the whole appeal for a home network: you get several separate networks for the price of one set of hardware.

How Does a VLAN Work?

A VLAN works by having the network switch assign each port, and every frame of data that enters it, to one VLAN ID, then forward each frame only to ports in that same VLAN.

Traffic headed for a different VLAN has to go through a router or Layer 3 switch.

To see why that’s useful, it helps to know what a switch normally does.

A switch learns the MAC address of every device on each port, then sends each Ethernet frame only to the port where its destination lives.

That works great for one-to-one traffic. The trouble starts with broadcasts.

Broadcast Domains: The Part VLANs Split Up

A broadcast domain is the group of devices that receive each other’s broadcast messages, and every VLAN is its own broadcast domain.

Devices broadcast more often than you’d think. When your laptop joins the network, it broadcasts a DHCP request asking any server out there for an IP address.

When that laptop wants to print, it sends an ARP broadcast asking which device owns the printer’s IP address, so it can learn the printer’s MAC address.

Every device in the broadcast domain hears that question, even the ones with no reason to care.

Laptop on a home office desk next to a small printer on the same network

On a flat network with dozens of smart home devices, all that chatter reaches everything.

With VLANs, a broadcast from the smart TV stays inside the smart home VLAN, and your work laptop never hears it.

That’s also a quiet security win. A device that can’t hear your laptop’s broadcasts has a much harder time finding it.

How the Switch Keeps VLANs Apart

The switch keeps VLANs apart by tracking three things for every frame: the port it came in on, the VLAN that port belongs to and the destination MAC address.

Here’s how it works:

  1. A frame arrives on port 3, which you’ve assigned to VLAN 20.
  2. The switch looks up the destination MAC address, but only among ports in VLAN 20.
  3. If the destination sits on a VLAN 10 port, the switch treats it as unreachable and drops the frame instead of delivering it.

All of this happens at Layer 2, the data link layer of the OSI model, which is the layer switches work at.

Routers and Internet Protocol (IP) addresses live one layer up, at Layer 3.

If you want the fuller picture of MAC tables and flooding, how a network switch works walks through it step by step.

For VLANs, the key point is simple: a VLAN-aware switch acts like several smaller switches sharing one metal box.

What Is VLAN Tagging?

VLAN tagging is how switches label each Ethernet frame with its VLAN ID when several VLANs share one cable, following the IEEE 802.1Q standard.

The tag tells the next switch, router or access point which VLAN the frame belongs to.

Tags solve a real problem.

Port-based VLANs work fine inside one switch, but the moment you connect two switches, or a switch and a router, one cable has to carry traffic for every VLAN.

So how does the far end know which frame belongs where?

According to SolarWinds’ IT glossary, when a frame passes from a VLAN port onto a trunk link, the 802.1Q standard inserts a 4-byte VLAN tag into the Ethernet frame header.

That tag is tiny, but it’s enough.

The receiving switch reads it, forwards the frame only to ports in that VLAN and usually strips the tag before handing the frame to an ordinary device.

Yellow Ethernet uplink cable plugged into a network switch port with its lights on

Your laptop, printer and TV never see the tag at all. They just send and receive normal frames, while the switches and routers handle the labeling.

The standard is part of the IEEE 802.1 family of networking standards from the IEEE, which is why VLAN tagging works between brands.

A TP-Link switch, a Netgear switch and a pfSense router can all read the same tags.

Want the frame-by-frame details? How VLAN tagging works covers tag fields and tagged versus untagged traffic in depth.

What Is a VLAN ID?

A VLAN ID is the number inside the 802.1Q tag that names which VLAN a frame belongs to, and it’s the same number you type into your router and switch when you create the VLAN.

The ID field is small. The tag holds a 12-bit VLAN ID, allowing for 4,096 possible VLANs, plus a 3-bit Priority Code Point used for Quality of Service.

That priority field is a nice bonus. It lets switches move delay-sensitive traffic, like a Voice over IP call, ahead of a big file download.

Not every one of those 4,096 values is usable, though. Two are reserved, leaving 4,094 usable IDs, which is still plenty of room.

A home network usually needs 3 to 5 IDs.

A common habit is to number them in tens, like 10, 20 and 30, and match each ID to the third number of that VLAN’s IP addresses, so 192.168.20.x means VLAN 20 at a glance.

That habit pays off later when you’re troubleshooting. A VLAN ID that matches its address range turns finding a device’s network into a 2-second check.

Access Ports vs. Trunk Ports

An access port belongs to one VLAN and connects a single end device, such as a PC or printer, that never sees a VLAN tag.

A trunk port carries several VLANs at once, with tags, between switches, routers and access points.

Hands labeling managed switch ports with colored tape to mark VLAN groups

You’ll set every switch port to one of these two jobs. Some brands use the words access and trunk, while others call the same settings untagged and tagged.

Access ports are the simple case:

  • A desktop PC plugs into port 5, set as an untagged member of VLAN 10.
  • A network printer plugs into port 6, untagged on VLAN 20.
  • Neither device needs any VLAN settings, because the switch adds and removes tags for them.

This setup, where each port belongs to one VLAN, is called a port-based VLAN, and it’s the most common way to assign wired devices.

Trunk ports carry the tagged traffic.

The cable from your switch to your router is a trunk, and so is the cable from your switch to any Wi-Fi access point that broadcasts more than one network name.

For example, an access point that broadcasts “Home,” “SmartHome” and “Guest” sends each network’s traffic down the same Ethernet cable with a different tag on it.

The switch reads those tags and keeps the 3 streams apart.

Getting the port types right is most of the work of setting up VLANs.

A trunk set as an access port drops tagged traffic, and an access port set as a trunk confuses the device plugged into it.

What Is the Native VLAN?

The native VLAN is the VLAN a trunk port puts untagged frames on, and on many switches it starts as VLAN 1, the default VLAN.

Every managed switch comes preconfigured with a default VLAN, typically VLAN 1, and every port starts as a member of it.

That’s why a brand-new managed switch behaves like a plain switch out of the box.

Two network switches linked by one yellow trunk cable on a basement shelf

The catch is what happens when you leave everything there.

If VLAN 1 carries your normal devices and also serves as the native VLAN on your trunks, any untagged frame lands right next to them.

A better pattern is to move your real devices to purpose-built VLANs and keep VLAN 1 for little or nothing.

The native VLAN settings differ by brand, so check them on every trunk before you call your setup finished.

How Do VLANs Work With Wi-Fi?

VLANs work with Wi-Fi by pairing each wireless network name (SSID) with one VLAN ID on the access point.

A phone that joins the “Guest” network lands in the guest VLAN automatically, with no settings on the phone itself.

The access point does the tagging.

When a laptop joins the “Home” network, the access point tags that laptop’s frames with the Home VLAN’s ID before sending them up its Ethernet cable.

That’s why the cable to a multi-SSID access point has to be a trunk. If it’s set as an access port, only one of the Wi-Fi networks gets through and the rest go quiet.

Here’s what a typical home Wi-Fi layout looks like:

  • “Home” (VLAN 10): Phones, laptops and tablets, with WPA3 if every device supports it.
  • “SmartHome” (VLAN 20): Smart plugs, bulbs and speakers, often on the 2.4 GHz band only, since many cheap gadgets can’t join 5 GHz.
  • “Guest” (VLAN 30): Visitors’ devices, with a password you don’t mind sharing.

Every extra network name adds a little airtime overhead, because each SSID sends its own beacons. That’s one more reason to keep the list short, usually 3 or 4 names.

White Wi-Fi access point mounted on a living room ceiling

A router’s built-in guest network is the simple version of this idea.

It gives you one isolated Wi-Fi name with no switch settings, but you usually can’t add more groups or put wired devices on it.

Mesh systems are a mixed bag here.

Some support one SSID per VLAN, while many consumer mesh kits only offer a single guest network, so check the spec sheet before you count on VLANs over Wi-Fi.

How Do Devices on Different VLANs Talk to Each Other?

Devices on different VLANs talk through a router or Layer 3 switch, which routes traffic between their separate IP address ranges and can block whatever you don’t allow.

Without that router step, two VLANs can’t exchange a single frame.

SolarWinds’ glossary puts it plainly: devices on different VLANs need Layer 3 routing to communicate.

That means giving each VLAN interface its own IP addresses on the router or Layer 3 switch.

In practice, that means each VLAN gets three things on the router:

  • A subnet, such as 192.168.20.0/24 for VLAN 20.
  • A gateway address, such as 192.168.20.1, that devices on that VLAN send outside traffic to.
  • A DHCP range, so new devices on that VLAN get an IP address automatically.

Those addresses come from the private ranges set aside by RFC 1918, the same 192.168.x.x space your home network already uses.

If IP addresses still feel fuzzy, how IP addresses work is worth 5 minutes before you plan your VLANs.

Small network file server sitting next to a home router on a media cabinet

Here’s what that looks like when a phone on VLAN 10 opens a photo on a file server on VLAN 30:

  1. The phone sees that the server’s IP address is outside its own subnet.
  2. It sends the request to its gateway, the router’s VLAN 10 address.
  3. The router checks its firewall rules, then forwards the request out its VLAN 30 interface.
  4. The reply comes back the same way in reverse.

Switches handle communication inside a VLAN by MAC address, while routers move traffic between VLANs by IP address.

That split is exactly why VLANs need both, and MAC vs. IP addresses explains the difference in more detail.

Do You Use a Router or a Layer 3 Switch?

Most home networks use the router for inter-VLAN routing, while larger networks often hand the job to a Layer 3 switch that routes between VLANs inside the switch itself.

At home, the usual layout is called “router on a stick.”

One trunk cable carries every VLAN from the switch up to the router, which routes between them and sends the answers back down the same cable.

That works because home traffic between VLANs is light. Most of your traffic goes out to the internet anyway, and the router handles that path no matter what.

A Layer 3 switch starts to make sense when lots of traffic crosses VLANs inside the house, like a home lab that moves big files between servers on different VLANs.

The switch routes that traffic at full port speed, while the router keeps handling the internet and the firewall.

Fanless mini PC with four Ethernet ports used as a home firewall router

Routers built for this include pfSense, OPNsense, Ubiquiti UniFi gateways and TP-Link Omada gateways.

Before you buy, check what to look for in a VLAN-capable router, since many ISP-supplied boxes have no VLAN settings at all.

The router is also where your home network firewall lives. That’s important, because routing between VLANs is wide open on many routers until you add rules that close it.

What Is a VLAN Used For?

A VLAN is used to split one physical network into groups that shouldn’t share traffic, such as guests, smart home gadgets, security cameras, work computers and VoIP phones.

A VLAN does that without separate switches or new cables.

At home, these are the uses that come up most:

  • Smart home isolation: Smart plugs, bulbs and TVs go on their own VLAN, so a hacked gadget can’t reach your computers. If you’re unsure where a device belongs, which devices go on an IoT network sorts the common ones.
  • Guest Wi-Fi: Visitors’ phones get internet access and nothing else.
  • Security cameras: Cameras and their recorder sit on a VLAN that can’t reach the internet or your laptops unless you allow it.
  • Work from home: A work laptop stays apart from the family’s devices and their traffic.
  • Home labs: Test servers and virtual machines get a sandbox, a big reason homelab builders plan their homelab network around VLANs.

Splitting a network into groups like this is called network segmentation, and performance gets a small lift from it too.

Smaller broadcast domains mean less background chatter reaching every device, which helps most on networks with lots of devices.

Smart plugs, a smart bulb, a smart speaker and a video doorbell on a kitchen shelf

And then there’s cost. One managed switch running 4 VLANs does the work of 4 separate switches, with 4 sets of cables, that you’d otherwise need to keep those groups apart.

The best VLAN use for most homes is simple: get the smart home devices off the network your computers use.

Why Businesses Use VLANs

Businesses use VLANs for the same reason homes do, keeping groups apart, but at a larger scale and with stricter rules about who can reach what.

A typical organization might run separate VLANs for staff laptops, VoIP desk phones, printers, guest Wi-Fi and network management.

The voice VLAN gets Quality of Service priority, so a call keeps its low latency when someone uploads a big file.

Retail stores add another reason.

Payment terminals sit on their own VLAN, away from the guest Wi-Fi and back-office computers, which shrinks the part of the network that handles card data.

Schools, hotels and data centers follow the same pattern with more VLANs.

That scalability, from a 3-VLAN apartment to infrastructure with thousands of servers, is why VLANs are a staple question in networking job interviews.

Do VLANs Slow Down Your Network?

VLANs don’t slow down traffic inside a VLAN, and they don’t add internet speed either.

Traffic that crosses between VLANs passes through your router, though, so a slow router or a shared trunk cable can become the bottleneck.

Inside one VLAN, a switch forwards frames at the same speed it always does. Reading a 4-byte tag costs it nothing you’d ever notice.

Routing between VLANs is different.

Every frame from your laptop to a NAS on another VLAN has to go up to the router and back down, often over the same trunk cable in both directions.

So if you copy big files between VLANs every day, two things help:

  • A router that can route and run firewall rules at your full wired speed, not just at your internet speed.
  • Keeping devices that trade lots of data, like a PC and its backup drive, in the same VLAN.

On the plus side, VLANs trim the broadcast and multicast noise that every device on a flat network has to process, which eases network congestion.

On a network with dozens of smart home gadgets, that cleanup can make the everyday user experience feel steadier, even though your speed test won’t change.

In other words, VLANs organize your bandwidth, they don’t create more of it.

What Are the Types of VLANs?

The common types of VLANs are the default VLAN, data VLANs, voice VLANs, management VLANs, the native VLAN and guest VLANs.

Each type is named for the job it does, since every VLAN works the same way underneath.

Here’s what each one is for:

  • Default VLAN: The VLAN every port starts in, usually VLAN 1.
  • Data VLAN: Carries ordinary user traffic from laptops, phones and desktops.
  • Voice VLAN: Carries VoIP phone traffic with Quality of Service priority, so calls stay clear when the network is busy.
  • Management VLAN: Holds the admin pages of switches, access points and controllers, kept away from everyday devices.
  • Native VLAN: Receives untagged frames on a trunk port.
  • Guest VLAN: Gives visitors internet access while blocking your own devices.

At home, you’ll mostly build data-style VLANs with friendlier names: Trusted, IoT, Guest and Cameras. The labels are yours to choose.

You’ll also hear VLANs sorted a second way, by how devices get assigned.

A static VLAN ties membership to a switch port, while a dynamic VLAN assigns a device by its MAC address or by protocol, wherever it plugs in.

Static, port-based assignment is what most home networks use, while the other types of VLANs mostly show up in business networks.

VLAN vs. LAN: What’s the Difference?

A LAN is the physical network of devices that share the same switches, cables and Wi-Fi, while a VLAN is a logical slice of that LAN set up in configuration.

Devices in one VLAN reach other VLANs only through a router.

Ethernet cables stapled along wooden basement joists in a home

Every VLAN runs on a LAN. You can’t have one without the other, so the real choice is between one flat LAN and a LAN split into VLANs.

The practical differences come down to a few points:

  • Border: A LAN’s border is its wiring. A VLAN’s border is a setting you can change in seconds.
  • Broadcasts: A flat LAN is one broadcast domain. Each VLAN is its own.
  • Moving devices: Moving a device between LANs means moving a cable. Moving it between VLANs means changing a port or Wi-Fi setting.
  • Gear: A LAN works with any switch. VLANs need switches and routers that support them.

So is a VLAN better than a LAN?

Splitting your LAN is better once you have devices you don’t trust, and it’s extra work you don’t need if you don’t.

The finer points of VLAN vs. LAN matter most when you’re deciding whether to split yours.

VLAN vs. Subnet

A VLAN separates devices at Layer 2, inside the switches, while a subnet separates IP addresses at Layer 3, inside the router.

A well-built network gives each VLAN exactly one subnet.

People mix them up because they almost always travel together. VLAN 20 gets 192.168.20.0/24, VLAN 30 gets 192.168.30.0/24, and so on.

But they aren’t the same thing. Two subnets on one flat LAN still share a broadcast domain, so a device can be moved into the other subnet just by changing its IP address.

A VLAN boundary can’t be bypassed that way, because the switch itself keeps the frames apart.

That’s why VLAN vs. subnet is worth understanding before you design a network around either one.

VLAN vs. VPN

A VLAN splits devices into separate networks in your home or office, while a VPN (virtual private network) builds an encrypted tunnel over an outside network like the internet.

A VLAN and a VPN solve different problems.

You’d use a VLAN to keep a smart TV away from your laptop. You’d use a VPN to reach your home network from a hotel, or to hide your traffic on public Wi-Fi.

They work together just fine. A VPN connection into your home can land on a specific VLAN, so a remote connection only reaches the devices you choose.

Do You Need a Managed Switch for VLANs?

Yes, you need a managed switch for VLANs, because an unmanaged switch has no settings for assigning ports to VLANs or handling tagged traffic.

The only exception is a network where every VLAN device connects over Wi-Fi to access points plugged straight into a VLAN-capable router.

Deploying VLANs requires a managed switch. That’s the first gear check to make, since the little switch behind the TV is often unmanaged.

The good news? You don’t always need a pricey enterprise model.

“Smart” or “easy smart” switches are a cheaper middle tier, and many of them support 802.1Q VLANs with a simple web page.

The real differences in managed vs. unmanaged switches are worth reading before you buy, because not every smart switch handles trunks well.

Hands holding a basic unmanaged switch next to a metal managed switch

The other two pieces of network equipment matter just as much:

  • Router: It needs VLAN interfaces, a DHCP server per VLAN and firewall rules between them.
  • Wireless access points: They need to broadcast multiple network names (SSIDs) and tag each one with a VLAN ID.

Many ISP combo boxes miss on both counts. If yours does, a common fix is to keep it as your modem and put your own router and wireless access points behind it.

Note: Check all 3 pieces of gear before you start. One device without VLAN support can break the whole plan.

Does Your Network Already Use VLANs?

Your home network may already use VLANs, because some fiber and TV providers tag their internet or IPTV traffic with a VLAN ID.

Many routers’ guest networks also run on a hidden VLAN behind the scenes.

The easiest place to spot this is your router’s internet (WAN) settings. Look for a field labeled VLAN ID, VLAN tagging, 802.1Q or IPTV.

If that field has a number in it, your provider expects tagged traffic on the line coming into your home.

Leave it alone unless you’re replacing the router, and then copy the same ID into the new one, or the internet connection won’t come up.

Fiber internet terminal on a utility room wall connected to a home router

TV service is the other common case. Some providers carry their TV streams on a separate VLAN, and the IPTV VLAN setting on your router decides whether it gets tagged.

Inside the house, the clues are different.

If your router offers several Wi-Fi networks with separate address ranges, or your switch has a VLAN page with ports already assigned, VLANs are in play.

Need to check which VLAN one device is on? Its IP address usually gives it away, and finding a VLAN ID shows where to look on common routers and switches.

Do You Need VLANs on Your Home Network?

Most home networks don’t need VLANs, but they’re worth setting up if you have lots of smart home devices, security cameras, a home lab or a work laptop to wall off.

With only phones and laptops, a guest network gives you most of the benefit.

VLANs earn their setup time when:

  • You own a growing pile of smart plugs, bulbs, speakers or TVs, especially cheap no-name ones.
  • You run security cameras and don’t want them talking to your computers.
  • You keep a NAS, Home Assistant box or test servers.
  • You work from home and handle sensitive work data.

You can skip them when your network is one ISP router, a few phones and a laptop.

In that case, setting up a guest network gives your smart gadgets and visitors a separate network in a few minutes, with no new hardware.

Hand sketching a simple home network plan of three groups in a notebook

Think of guest Wi-Fi as a one-VLAN starter kit. Once you want more than one isolated group, or wired devices on separate networks, it’s time for real VLANs.

When you get there, the next step is picking the VLANs and wiring them up. Home network VLANs covers which ones to create, the gear and a step-by-step setup with firewall rules.

Are VLANs Secure?

VLANs make a network more secure by keeping groups of devices apart, but a VLAN isn’t a full security tool on its own.

Without firewall rules, or with a misconfigured trunk or native VLAN, traffic can still cross between VLANs.

The first gap in VLAN-based network segmentation is the router. Many routers pass traffic between VLANs freely until you write firewall rules that block it.

A VLAN with no firewall rules is mostly just a different IP address range.

The second gap is configuration.

Attacks called VLAN hopping trick a switch into delivering frames to a VLAN they shouldn’t reach, usually by abusing a trunk port or a native VLAN left on its defaults.

VLAN hopping comes in 2 common forms. In switch spoofing, a device pretends to be another switch so a port that auto-negotiates trunking hands it every VLAN.

In double tagging, an attacker on the native VLAN sends a frame with two tags stacked on it.

The first switch strips the outer tag, and the next switch delivers the frame using the hidden inner one.

Both tricks depend on loose defaults. That’s good news, because a few settings shut them down.

The fixes are boring but effective:

  • Set every port that connects a single device as an access port, never a trunk.
  • Keep the native VLAN off your real device VLANs.
  • Put switch and access point admin pages on a VLAN only your trusted devices can reach.
  • Change default admin passwords on every switch and access point.

Even then, VLANs are one layer of network security, not the whole wall.

Firmware updates, strong passwords and malware protection still matter, and VLAN security goes deeper into the common mistakes.

Key Takeaway: VLANs work best as one part of a broader plan for home network security, not a replacement for it.

A Simple VLAN Example for a Home Network

A simple VLAN example is a home running 3 VLANs on one router, one managed switch and one Wi-Fi access point.

VLAN 10 holds computers and phones, VLAN 20 holds smart home devices and VLAN 30 holds guests.

This home is hypothetical, but its layout is a common place to start:

  • VLAN 10, Trusted: Laptops, phones and a NAS, on 192.168.10.0/24.
  • VLAN 20, IoT: A smart TV, 6 smart plugs and a video doorbell, on 192.168.20.0/24.
  • VLAN 30, Guest: Visitors’ phones, internet only, on 192.168.30.0/24.

The access point broadcasts 3 Wi-Fi names and tags each one. The cable from the access point to the switch is a trunk, and so is the cable from the switch to the router.

Now follow one smart plug as it checks in with its cloud service:

  1. The plug joins the “SmartHome” Wi-Fi, and the access point tags its frames with VLAN 20.
  2. The switch carries those tagged frames up the trunk to the router.
  3. The gateway sees a request for the internet, checks its rules and lets it out.

Now say that same plug gets hacked and tries to scan the laptops on VLAN 10.

Its frames still reach the router, but the router’s rules block any new connection from VLAN 20 into VLAN 10, so the scan finds nothing.

Smart TV in a living room, a common device for an IoT VLAN

That’s the payoff in one picture. The plug keeps working, and your laptops stay out of its reach.

One side effect to plan for: casting from your phone to the smart TV may stop working, because device discovery doesn’t cross VLANs on its own.

Routers that support mDNS reflection or a similar feature can fix it.

How Do You Set Up a VLAN?

You set up a VLAN by creating it on your router with an ID, subnet and DHCP range, then assigning switch ports and a Wi-Fi network to it.

Firewall rules on the router then control what may cross between VLANs.

Here’s the short version of the order:

  1. Plan each VLAN’s ID, name, subnet and the devices that go on it.
  2. Create the VLAN interfaces on the router.
  3. Set the switch’s trunk and access ports.
  4. Map one Wi-Fi network per VLAN on your access points.
  5. Add firewall rules, then test from each VLAN.

The menus differ by brand, so match those steps to your gear’s VLAN configuration screens.

Keep one wired port on your trusted network untouched while you work, so a wrong setting can’t lock you out.

Common VLAN Mistakes to Avoid

Hands using a network cable tester on an Ethernet patch cable

The most common VLAN mistakes are a missing DHCP server, an access point uplink set as an access port, VLANs split by room and more VLANs than you can maintain.

Each VLAN mistake has a clear symptom that points to its fix.

Here’s what to watch for:

  • No DHCP on the new VLAN: Devices connect but show a 169.254.x.x address and no internet. Add a DHCP range for that VLAN on the router.
  • Access point uplink set as an access port: Only one of your Wi-Fi networks works. Set that switch port as a trunk carrying every VLAN the access point broadcasts.
  • VLANs split by room: You end up with an “Upstairs” and a “Downstairs” VLAN full of mixed devices. Group devices by how much you trust them instead.
  • Too many VLANs: Every VLAN needs its own rules, and 8 VLANs means a lot of rules to get right. Start with 3 and add more only for a clear reason.
  • Blocking replies by accident: Rules that block IoT from reaching your trusted VLAN can also stop your phone from controlling the TV. Allow trusted devices to start connections, and let the router pass the replies back.

Pro Tip: Change one thing at a time and test after each change. When something breaks, you’ll know exactly which setting did it.

The Bottom Line on VLANs

A VLAN is a separate network carved out of the gear you already own, and its biggest job at home is keeping untrusted devices away from the ones you care about.

This week, check whether your router and switch support 802.1Q VLANs.

If they do, list every device in your house and sort it into Trusted, IoT or Guest. That list is your first VLAN plan.

Frequently Asked Questions

Is a VLAN better than a LAN?

A VLAN isn’t better than a LAN so much as a way to divide one, because every VLAN still runs on a LAN’s switches and cables.

Splitting your LAN into VLANs is better when you have devices you don’t trust, like smart plugs or guests’ phones, that you want kept away from your computers.

What are the three types of VLANs?

The three types of VLANs people usually mean are data VLANs for everyday devices, voice VLANs for VoIP phones and management VLANs for network gear.

Some lists use 3 ways of assigning devices instead: by switch port, by MAC address or by protocol.

How do I configure inter-VLAN routing?

You configure inter-VLAN routing by giving each VLAN its own subnet and gateway IP address on your router or Layer 3 switch, then connecting that router to the switch with a trunk port that carries every VLAN.

Finish with firewall rules that say which VLANs may start connections to which.

How do you explain a VLAN in an interview?

A VLAN is a Layer 2 broadcast domain created by configuration instead of wiring: switches tag frames with an IEEE 802.1Q VLAN ID and forward them only to ports in the same VLAN.

Add that traffic between VLANs needs Layer 3 routing, and give a quick example like separating guest Wi-Fi from staff devices.

How many VLANs can you have on one network?

One network can have up to 4,094 usable VLAN IDs under the 802.1Q standard.

Home networks rarely need more than 3 to 5, because each extra VLAN means more firewall rules to maintain.

Andre Thibodeaux
Andre Thibodeaux

I'm Andre, a Lowell, Massachusetts guy who spent nine years pulling Cat6, terminating patch panels and mounting access points in homes and small offices. Here I write about routers, home internet, wired networking, security and home labs, and my favorite part is helping nervous first-timers run their first cable and feel good about it.

More about Andre Thibodeaux →