Learn/How to Create a Smart Home Network VLAN for IoT Security

How to Create a Smart Home Network VLAN for IoT Security

Β·0 Views

This article may contain affiliate links. If you make a purchase through these links, we may earn a small commission at no extra cost to you. This helps us keep creating free content.

How to Create a Smart Home Network VLAN for IoT Security

Let me tell you something that keeps me up at night as a software engineer: every smart home device on your network can potentially see every other device on your network. That cheap WiFi smart plug from Amazon? It can see your NAS, your laptop, your work computer with the VPN connection to your company's network. The Tuya firmware phoning home to servers in Shenzhen? It is on the same subnet as your family photos.

Most smart home devices have terrible security. They run outdated firmware, use unencrypted protocols, and many phone home to cloud servers you have no control over. The solution is not to avoid smart devices, it is to isolate them on their own network segment using VLANs. This guide walks you through setting it up, even if networking is not your primary skill.

What Is a VLAN and Why Does It Matter?

A VLAN (Virtual Local Area Network) is a logical network separation within your physical network. Think of it as creating separate networks without buying separate routers. Devices on VLAN 10 cannot directly communicate with devices on VLAN 20 unless you explicitly allow it through firewall rules.

Smart home network vlan iot security: practical guide overview
Smart home network vlan iot security

For a smart home, this means your IoT devices (bulbs, plugs, cameras, sensors) live on an isolated network. If one of them gets compromised, the attacker is stuck on a network with nothing but other light bulbs. They cannot reach your computers, your phone, your NAS, or anything with personal data.

Real-world example: In 2019, researchers demonstrated that a compromised smart bulb could be used to exfiltrate data from a home network. In 2023, a vulnerability in a popular camera brand allowed attackers to move laterally to other devices on the same subnet. VLANs make these attacks dead ends.

What You Need

πŸ“‘

Amazon eero Pro 6E Wi-Fi 6E Mesh System (3-Pack)

Tri-band Wi-Fi 6E, 6,000 sq.ft, built-in Zigbee + Thread border router, the smart-home-aware mesh.

See on Amazon β†’

Not every router supports VLANs. Here is what you need:

Smart home network vlan iot security: step-by-step visual example
Smart home network vlan iot security
  • A VLAN-capable router: UniFi Dream Machine (any model), pfSense/OPNsense on a mini PC, or a prosumer router like MikroTik. Most consumer routers (Netgear Nighthawk, TP-Link Archer, etc.) do NOT support VLANs. This is the biggest barrier to entry.
  • A managed switch (optional but recommended): If you have wired IoT devices. A TP-Link TL-SG108E ($30) supports VLANs and is enough for most homes.
  • VLAN-capable WiFi access points: UniFi APs, TP-Link Omada, or any AP that supports multiple SSIDs mapped to VLANs. Your AP needs to broadcast a separate WiFi network for IoT devices.

The Network Architecture

Here is the setup I run and recommend for most smart homes:

VLAN Subnet WiFi SSID Devices
VLAN 1 (Default)192.168.1.0/24HomeNetworkPhones, laptops, tablets, NAS
VLAN 20 (IoT)192.168.20.0/24IoT-DevicesSmart bulbs, plugs, sensors, cameras
VLAN 30 (Server)192.168.30.0/24-Home Assistant, media server (wired only)

VLAN 30 for the server is optional but nice. It means your HA server can talk to IoT devices (via firewall rules) but is separated from your personal devices too. If you want to keep things simpler, put HA on your default VLAN and just isolate the IoT devices.

Step-by-Step: UniFi Setup

I will use UniFi as the example because it is the most common prosumer setup. The concepts translate to any VLAN-capable router.

Smart home network vlan iot security: helpful reference illustration
Smart home network vlan iot security

Step 1: Create the VLAN

In the UniFi Network Controller, go to Settings, Networks, and click Create New Network. Name it "IoT" and set the VLAN ID to 20. Enable DHCP and set the subnet to 192.168.20.0/24. The gateway will automatically be 192.168.20.1.

Step 2: Create the IoT WiFi Network

Go to Settings, WiFi, and create a new WiFi network. Name it something like "SmartHome-IoT" (your devices do not care about the name). Under Advanced, assign it to the IoT network you just created. Set it to WPA2 (some IoT devices do not support WPA3).

WPA2, not WPA3: Many smart home devices, especially budget ones from Tuya, Sonoff, and similar brands, only support WPA2. If you set your IoT WiFi to WPA3-only, half your devices will not connect and you will spend hours troubleshooting. Use WPA2 for the IoT SSID. Your main network can use WPA3.

Step 3: Configure Firewall Rules

This is the critical part. Without firewall rules, VLANs can still communicate with each other by default on some routers. You need explicit rules:

  1. Block IoT to LAN: Create a rule that blocks all traffic from VLAN 20 (IoT) to VLAN 1 (your personal network). This is the isolation that protects your devices.
  2. Allow IoT to Internet: Allow VLAN 20 to reach the internet. Many smart devices need cloud connectivity to function (or for initial setup, at least).
  3. Allow HA to IoT: Create a rule that allows traffic from your Home Assistant server's IP to VLAN 20. This lets HA discover and control IoT devices.
  4. Allow IoT to HA: Allow traffic from VLAN 20 to your HA server's IP on specific ports (8123 for the web UI, 5353 for mDNS, 1883 for MQTT). This lets devices push updates to HA.
  5. Block IoT to IoT (optional): If you are paranoid (and as a security-conscious engineer, I am), you can also enable client isolation on the IoT WiFi. This prevents IoT devices from talking to each other directly, forcing all communication through HA.
Smart home network vlan iot security: detailed close-up view
Smart home network vlan iot security

Step 4: Reconnect Your IoT Devices

Now comes the tedious part. You need to reconnect every smart device to the new IoT WiFi network. For WiFi devices, this usually means resetting them and going through setup again with the new SSID. For Zigbee and Z-Wave devices that connect through a coordinator, no change is needed, they do not use WiFi.

Zigbee devices are already isolated: If you use Zigbee devices with a coordinator plugged into your HA server, those devices are not on your WiFi at all. They communicate via the Zigbee protocol directly with the coordinator. This is one of the security advantages of Zigbee over WiFi devices. See our protocol comparison for more details.

The mDNS Problem (and How to Fix It)

Here is where most VLAN setups break: mDNS. Many smart home devices use mDNS (Multicast DNS) for discovery. When devices are on a different VLAN, mDNS broadcasts do not cross the VLAN boundary by default. This means Home Assistant cannot discover devices on the IoT VLAN automatically.

The fix is an mDNS reflector. On UniFi, enable "Multicast DNS" under Settings, Network, Global Settings. On pfSense/OPNsense, install the Avahi package which reflects mDNS across VLANs. This allows discovery to work while keeping the actual traffic isolation in place.

Dealing With Devices That Break

Some devices genuinely need to be on the same VLAN as your phone to work. Chromecast and AirPlay devices are the classic examples, they require the casting device and the receiver to be on the same network. Options:

  • Put casting devices on the main VLAN: A Chromecast is a Google device that you explicitly trust. It is not a random IoT widget.
  • Enable IGMP/multicast proxying: This allows casting protocols to work across VLANs without full network access. More complex to set up but technically cleaner.
  • Use targeted firewall rules: Allow specific traffic types (like mDNS and SSDP) between VLANs while blocking everything else.

DNS-Level Blocking for IoT Devices

As a bonus security layer, point your IoT VLAN's DNS to a Pi-hole or AdGuard Home instance. This lets you block telemetry domains that IoT devices phone home to. You can see exactly which devices are calling home, how often, and to which servers.

When I first set this up, I was surprised to see a single smart plug making 800+ DNS requests per day to various Chinese cloud servers. On the IoT VLAN with DNS filtering, those requests are silently blocked and the plug still works locally with Home Assistant.

Is This Overkill?

Honestly? For most people with 10-20 smart devices, a simple IoT VLAN is not overkill. It is reasonable security hygiene. You lock your front door even though most burglars target other houses. Network segmentation is the digital equivalent.

What IS overkill is going full enterprise with 6 VLANs, per-device firewall rules, and 802.1X authentication for every light bulb. Start with one IoT VLAN, get comfortable with the concept, and add complexity only when you have a specific need.

Minimum viable VLAN setup: One IoT VLAN with a separate WiFi SSID, one firewall rule blocking IoT-to-LAN traffic, and mDNS reflection enabled. That is it. You can set this up in under an hour on a UniFi system and it immediately isolates your entire smart home from your personal devices. For more on securing your smart home, read our data privacy guide.

⚑Disclaimer: This article is for informational purposes only. Smart home installations may involve electrical wiring and must comply with local building codes. Electrical work should only be performed by a licensed electrician.

Published by the SmartHome Automate editorial team. Published August 9, 2026.

Editorial responsibility: see Imprint.

Spotted an error or have something to add? corrections@smarthomeautomate.com

Found this helpful? Share it:
securitynetworkingVLANguideadvanced
πŸ“–

Explore more

All articles on SmartHome Automate β†’

🏠

Smart Home Tips, Delivered

New guides, device reviews, and automation ideas β€” every week in your inbox.

🎁 Free bonus: Smart Home Starter Checklist (PDF)

🧭Part of our topic hub: Protocols & Networkingβ†’

You might also like

Comments (0)

Leave a comment

Comments are reviewed before publishing.