UniFiGuide
network-design

UniFi VLAN Segmentation: IoT, Guest, and Trusted

A practical model for VLANs on a UniFi network — why you segment, what trusted/IoT/guest each need, tagged vs untagged ports, and the inter-VLAN firewall rules that make segmentation real.

By Editorial · · 8 min read

A flat network — every device on one subnet, everything able to talk to everything — is fine until it isn’t. The moment you add a cheap smart bulb, a guest’s laptop, or a camera you don’t fully trust, “everything can reach everything” stops being a convenience and becomes the problem. VLANs are how you fix that on UniFi without buying more hardware. This guide is the model, not a click-by-click, because the why is what people get wrong.

What a VLAN actually buys you

A VLAN is a separate Layer 2 network running over the same physical switches and access points. Devices in different VLANs are, by default, in different broadcast domains and different subnets — they can’t reach each other unless a router explicitly allows it.

The value isn’t the VLAN itself. It’s the default deny between segments. Segmentation only does something if traffic between segments is blocked by default and you allow exceptions deliberately. A VLAN with a firewall rule that says “allow all between VLANs” is just extra configuration buying you nothing.

A sane three-to-four VLAN model for homes/small offices

You don’t need a dozen VLANs. Most networks are well served by:

The principle behind the split: group devices by how much you trust them and what they legitimately need to reach, not by device category for its own sake.

Tagged vs untagged ports — the part that confuses everyone

This trips up nearly everyone configuring UniFi switching the first time:

Rules of thumb:

The classic mistake is tagging a VLAN on an access port to a single device that doesn’t understand tags — the device then can’t communicate. If one device, one VLAN: untagged.

Mapping Wi-Fi to VLANs

On UniFi, each SSID can be bound to a network/VLAN. So you typically create:

The access point’s switch port must carry those VLANs (tagged), and the AP must be on a UniFi setup where the gateway routes and filters between them. The SSID is just the entry point; the segmentation is enforced by routing + firewall, not by having separate SSIDs alone. Separate SSIDs with no firewall rules between their VLANs is theater.

The firewall rules that make it real

Segmentation is only as good as the inter-VLAN rules. With a UniFi gateway doing the routing, the model you want is default deny between VLANs, with narrow allows:

  1. Block inter-VLAN by default. New traffic initiated from IoT/Guest/Cameras toward Trusted should be dropped.
  2. Allow established/related back. When Trusted initiates a connection out to, say, an IoT device, the return traffic must be allowed (stateful return), without opening IoT→Trusted initiation.
  3. Allow only the specific exceptions you need. Examples: Trusted → IoT on the ports your home-automation hub needs; Trusted → Cameras for the NVR UI; a specific printer reachable from Trusted only.
  4. Guest gets internet only. No inter-VLAN, no reaching the gateway’s admin, client isolation on.

The mental model: connections flow from more-trusted to less-trusted by exception, and return traffic for those is permitted statefully. Less-trusted segments never initiate into more-trusted ones. If you can’t articulate which direction a rule allows, you don’t yet have a rule you should keep.

Common ordering and rule mistakes

A pragmatic rollout

  1. Start with Trusted + Guest only. Get a clean default-deny working and verified.
  2. Add IoT, move noisy/untrusted devices over, confirm they still reach the internet and nothing reaches Trusted.
  3. Add Cameras if you run UniFi Protect, isolated, with only the NVR UI reachable from Trusted.
  4. Add allow exceptions one at a time, each justified by a specific need, each placed above the deny.

Done this way, segmentation is robust and debuggable. Done as “lots of VLANs, allow-all between them,” it’s just complexity with none of the benefit. For the groundwork this builds on and the pieces it touches, see controller hosting options, the guest network and captive portal done properly, switch port and PoE planning, and the rest of our UniFi guides.

#vlans #network-design #iot #firewall #switching

Related

Comments