VLANs Without the Headache: Segment Your IoT, Camera, and Guest Networks

Every homelab guide eventually says the same thing: put your IoT gadgets, cameras, and guests on their own VLANs. Few explain what a VLAN actually is, and fewer still cover the two places beginners really get stuck — the port settings on the switch, and the moment casting and AirPlay stop working afterwards. This guide covers both, in plain terms, with a starter layout small enough to finish in an evening. It is the networking layer of the homelab map in our homelab components guide.

Published Nov 19, 2026 · Last updated Nov 19, 2026

What a VLAN actually is

Start with the network you already have. Right now, everything in your home — laptops, phones, the NAS, smart plugs, cameras, the TV — almost certainly sits on one single network, where any device can, in principle, try to talk to any other. Your camera can attempt a connection to your laptop; a cheap smart plug with questionable firmware can scan for your NAS. Mostly they don't, but nothing structural stops them.

A VLAN — a virtual LAN — carves that one network into several separate networks that still share the same cables and switch. Each VLAN gets its own address range (its own subnet) and one firm rule: traffic does not cross between VLANs unless the router explicitly carries it across, and the router only does that when a firewall rule says it may. That is the entire point. The segmentation is not a suggestion devices politely follow; it is enforced by the switch and the router, in paths the devices cannot argue with.

The mechanism is a label. Ethernet frames traveling between VLAN-aware devices carry a small tag — a number, from 1 to 4094, defined by the 802.1Q standard — that says which network the frame belongs to. The switch reads the tag and keeps each network's traffic apart, the way a mailroom sorts letters into separate pigeonholes even though they all arrived through the same slot. Devices themselves never see the tag; the switch adds and removes it at the port. Your job is mostly telling each port which pigeonholes it serves.

One clarification: a VLAN is a wired-Ethernet idea. Zigbee and Thread devices are not on any VLAN — they live on their own radio networks and reach Ethernet through a coordinator or border router. Planning radio channels instead of wired segments is a different layer; our Zigbee, Thread and Wi-Fi channel planner covers it. Wi-Fi devices, though, absolutely land on VLANs, through the access point — which brings us to the hardware.

The three pieces of hardware that have to agree

VLANs fail for a boring reason more often than any other: one box in the chain does not speak the language. All three of these must be VLAN-aware, or the design silently collapses back into one flat network:

For scale: a managed switch with faster ports — the MikroTik CRS310-8G+2S+IN, with eight 2.5-gigabit ports and two 10-gigabit SFP+ cages — was $191.70 when we checked in November 2026, and a PoE model such as TP-Link's TL-SG208PE was $62.99 in the same check. The switch is rarely the budget problem in this project; the router you already own is the part most likely to need replacing.

Tagged, untagged, and PVID: the part where setups actually fail

Here is the one distinction the whole setup turns on. Almost every "my VLANs don't work" thread is, underneath, this section.

A laptop or camera knows nothing about tags. It sends plain, untagged frames and expects plain frames back, so the switch port it plugs into handles the labeling for it. That kind of port is an access port: it belongs to exactly one VLAN, configured with two settings that describe the same fact from two directions:

The other kind of port is a trunk port: one cable carrying several VLANs at once, every frame keeping its tag so the device at the other end can sort them. Trunks link VLAN-aware boxes — switch to router, switch to access point, switch to a server or NAS hosting things on more than one network. On a trunk, one VLAN is usually also sent untagged (the "native" VLAN in some vendors' language); the rest are tagged members.

Every vendor names these settings differently, which is half the battle. A translation table for the interfaces you are most likely to meet:

ConceptTP-Link (SMB switches)UniFiMikroTik (RouterOS)Cisco-style CLI
Port for one end deviceUntagged member of one VLAN, PVID set to matchPort profile with one "native" networkAccess port on the bridge, PVID setAccess port, one VLAN
Port carrying many VLANsTagged member of each VLANPort profile with tagged networks allowedTrunk port, tagged VLAN listTrunk port, allowed VLAN list
The stamp for incoming untagged framesPVID field"Native network" choicePVID on the bridge portAccess VLAN / native VLAN

Two failure modes to recognize. First: you tag the trunk to the router but forget the PVID on a camera port — the camera's frames get stamped with the default VLAN 1, it picks up an address on the main network, and your camera segment looks empty while the camera works in the wrong place. Second: the access point's trunk is missing one tagged VLAN, so the IoT SSID exists, devices join it, and they receive no address at all. When something is wrong, ask one question: does the device get an address, and from which network? That tells you whether the tagging or the routing is at fault.

A starter layout that is enough

Segmentation advice online tends to end with eight or ten networks, including separate ones for printers, work laptops, and the thermostat. Resist this. Every VLAN you add is a set of firewall rules to reason about and a new way for something to break on a Tuesday night. Beginner guides converge on the same advice: start with three or four, live with them for a month, and add a segment only when you can name the specific device and the specific worry it addresses. Four is plenty for most smart homes:

VLANWho lives thereThe worry it answers
Main (e.g. VLAN 10)Your phones, laptops, and computers— this is the trusted core everything else is measured against
Servers (e.g. VLAN 20)NAS, Home Assistant, Jellyfin, your Docker stackServices are reachable by the house but cannot wander into your computers
IoT (e.g. VLAN 30)Smart plugs, bulbs, appliances, robot vacuums, voice assistantsThe $12 gadget with abandoned firmware can reach the internet and nothing else
Cameras (e.g. VLAN 40)IP cameras and the doorbellCameras are the devices people least want talking to the internet or the LAN — see below
Guest (optional, e.g. VLAN 50)Visitors' phonesGuests get internet and nothing else, not even each other

Each VLAN gets its own subnet — main might be 192.168.10.0/24, servers 192.168.20.0/24, IoT 192.168.30.0/24, with the VLAN number echoed in the address purely as a memory aid. Your router hands out addresses (DHCP) separately on each one.

Why do cameras get their own segment rather than sharing IoT? The traffic pattern is different and the trust is lower. Cameras stream continuously to one place — your recorder — and in a local-first setup they have no business reaching the internet at all; many will try anyway, phoning home to a vendor cloud unless the firewall says no. On their own VLAN, "no internet, talk only to the recorder" is two rules. Our camera guides, starting with Frigate NVR with Home Assistant, assume exactly this arrangement — the single segmentation step with the clearest payoff.

What about a separate management VLAN for the switch and access point admin pages? A reasonable fifth segment later, once the basics are stable. On day one it mostly adds a new way to lock yourself out of your own switch — a real risk, addressed below.

The layout above is generated for you — with your own first two octets — by the Subnet & VLAN Planner, which also works out gateways and DHCP ranges per segment and splits any network into equal subnets.

Internet ↓ Router / firewall ↓ Managed switch MAINPhones, laptopsTrusted devicesReaches the others IoTPlugs, bulbs, TVTalks to the hub,not to your laptop CAMERASRecorder reaches inNo internet accessNo route to Main GUESTVisitors’ phonesInternet onlySees nothing local One cable into the switch carries all four networks — the tags keep them apart.
The starter layout: four networks on one switch. The firewall rules below decide which ones may talk to each other.

Firewall rules between VLANs, in plain English

Creating the VLANs separates the networks; the firewall rules decide what crosses. Firewalls like OPNsense and pfSense are stateful, which gives you a gift: if a device on network A may start a conversation with a device on network B, the replies are allowed back automatically. You write rules about who may start conversations, and the firewall handles the rest. The pattern below starts from "nothing crosses" and opens exactly the doors a smart home needs:

Who starts itTo whomVerdictWhy
MainEverywhereAllowYour own devices can reach the NAS, Home Assistant, IoT controls, and the internet
ServersIoTAllowHome Assistant lives here and must be able to control the plugs and bulbs it manages
ServersMainBlock new connectionsA compromised service should not be able to go browsing your laptop; replies to your requests still flow
IoTInternetAllowCloud-dependent gadgets keep working
IoTMain, Servers (new connections)BlockThe gadget never initiates contact with your files or computers — Home Assistant reaches it, not the reverse
CamerasThe recorder (Frigate/NVR) onlyAllow, narrowlyStreams go where they are recorded; nothing else
CamerasInternet and all other VLANsBlockNo phoning home, no lateral movement — the whole point of the segment
GuestInternetAllowGuests get what they came for
GuestEverything local, including other guestsBlockIsolation in both directions

Read the IoT rows together, because they are the ones people find counterintuitive: IoT devices cannot start a conversation with Home Assistant, yet Home Assistant controls them fine, because the control connection starts from the server side and the replies ride back on the stateful allowance. The exception to plan for is devices that push events to a server — some sensors, buttons, and local-push integrations initiate the connection themselves. When one stops working after segmentation, the fix is a single narrow rule (that device, that destination, that port), not reopening the whole segment.

The day casting broke: discovery and the mDNS fix

Here is the experience nearly everyone has, usually within the hour: the VLANs are up, the rules are in, everything pings — and the TV has vanished from the cast menu, AirPlay finds no speakers, the printer is gone, and a HomeKit accessory shows "No Response." Nothing is broken. You have met discovery.

Phones find cast targets, speakers, printers, and HomeKit accessories by listening for announcements sent using mDNS (multicast DNS, sometimes labeled Bonjour). Those announcements are deliberately local: broadcast within one network, they stop dead at its boundary — exactly the boundary you just built. A phone on the main VLAN and a TV on the IoT VLAN are both healthy; they simply cannot hear each other, the way two rooms with a closed door muffle a conversation.

The fix is a small piece of software on the router called an mDNS reflector (or repeater). It sits on two or more networks at once, listens for announcements on each, and repeats them across, so a phone on Main hears the TV on IoT announcing itself. On OPNsense it is a plugin (the mDNS repeater); on pfSense it is the Avahi package; many prosumer routers and UniFi systems have a toggle named "mDNS" or "multicast DNS proxy." Three cautions:

Not locking yourself out, and a testing checklist

The rite of passage nobody warns you about is changing a switch setting and realizing your computer — which was managing the switch — is now on the wrong side of your own segmentation. Avoid it with procedure, not cleverness: keep one switch port on the original network until the very end, work from a machine plugged into it, and move that last port only once everything else tests clean. Change one thing at a time, and after each change, run this checklist from a device on each VLAN:

  1. It gets an address — from the correct subnet for its segment. (Wrong subnet means a PVID or trunk problem, per the failure modes above.)
  2. It can reach the internet, if its segment is supposed to.
  3. It can reach the local things it should: your phone opens Home Assistant; Home Assistant still controls a plug; the recorder still shows every camera.
  4. It cannot reach one thing it should not: from IoT, try opening the NAS admin page. Failure here is success.
  5. Casting and AirPlay work from your phone to a device on the IoT network, with the reflector enabled.

Only when all five pass on every segment should you move the family's devices over — and even then, move them in groups (IoT tonight, guests when the next guest arrives), so when something odd surfaces a week later, the list of suspects is short.

Part of the Homelab guides

This guide is one part of the site's homelab coverage. The Homelab hub gathers all of it in one place — the start-here map of every layer, your first Proxmox node, OPNsense vs pfSense in 2026, UPS sizing by watts, what a homelab costs to run, 3-2-1 backups that actually restore.

Official documentation and references

FAQ

Do I actually need VLANs at home?

Not always. If your network is a router, a few computers, and some smart bulbs you trust, a single flat network is fine and simpler. VLANs earn their complexity when you have devices you cannot vouch for — cheap IoT gadgets, IP cameras, a work laptop, guests — and you want them able to use the internet without being able to browse your NAS, your computers, or each other. The trigger is usually a specific worry ("my cameras should not be able to see my files"), not a general feeling that a serious network has them.

Why did my Chromecast and AirPlay disappear after I set up VLANs?

Because discovery does not cross between networks. Casting, AirPlay, HomeKit, and printer discovery find each other using mDNS announcements, which are local-network broadcasts that stop at the boundary between VLANs by design. Your phone and the TV are both working; they simply cannot hear each other. The fix is an mDNS reflector (also called a repeater) running on the router, which listens on two networks and repeats the announcements across. Enable it only between the pairs of VLANs that need it — typically your main network and the IoT network.

Can I set up VLANs with my ISP router and the switch I already have?

Usually not, and this is the most common reason a first attempt fails. All three pieces have to understand VLANs: a managed switch that can tag ports, a router or firewall that can route between the networks and enforce rules, and — for Wi-Fi devices — an access point that can attach different SSIDs to different VLANs. Most ISP routers and unmanaged switches cannot do any of that. An unmanaged switch anywhere between the router and a device silently strips the separation away, because it passes everything to everyone.

Related guides