geekcowboy.net

Home automation

A network of their own for smart-home devices in 2026: the options compared, and a tested OpenWrt setup

Why smart plugs and cameras should not share a network with your laptops and NAS, five ways to separate them compared (guest Wi-Fi, a router's "IoT network", OpenWrt, UniFi or Omada, and radios that never touch Wi-Fi), the firewall policy that keeps Home Assistant, phone apps and casting working, and one complete OpenWrt script with the checks to run afterwards.

A smart plug is a small computer on your Wi-Fi that may stop getting updates the day its maker loses interest, talking to a cloud you do not control. On the same network as your laptop and NAS, whoever takes it over is already inside the house. Here is how to give those devices a network of their own: what to block and what to allow, the options for each kind of router, what Home Assistant, phone apps and casting need to keep working, and a complete OpenWrt setup, tested as far as a container allows.

Why the gadgets get their own network

Three reasons:

  • Abandoned products. Belkin ended cloud and app support for a list of Wemo products on 31 January 2026. Remote access and voice-assistant control stopped; only devices already set up in Apple’s HomeKit, or Thread-based ones, keep working locally.
  • Devices compromised before they are unboxed. In June 2025 the FBI warned about BADBOX 2.0, a botnet of “millions of infected devices”: TV streaming boxes, projectors, digital picture frames and car infotainment units, some infected before purchase, used as residential proxies for crime.
  • Cloud dependence. When the maker’s servers go, every feature that needed them goes too, as Wemo owners found.

A separate network does not fix a bad device. It limits what that device can reach: the internet (unless you block it), but not your computers, your NAS or your router’s admin page. Advice on updates and buying is in staying safe online; this article is the network part.

The policy

Whatever the hardware, aim for this:

From To Rule
IoT internet allowed; blocked per device for things that work without it
IoT your LAN blocked, with narrow exceptions (MQTT to Home Assistant)
LAN IoT allowed
either either replies to a connection that was allowed: allowed
IoT the router DHCP and DNS (plus IPv6 neighbour discovery and mDNS); no admin page, no SSH

The fourth row is what makes the rest work. A stateful firewall remembers connections, so when Home Assistant on the LAN opens one to a plug, the plug’s answers come back (“established, related”), but the plug cannot open a new connection to your laptop.

The options

Approach Keeps IoT off the LAN Home Assistant and apps on the LAN Discovery and casting What you need
Router’s guest Wi-Fi yes, but all or nothing usually cannot reach the devices no any router
A consumer router’s “IoT network” TP-Link Deco: not by default; ASUS: with its own subnet Deco with Device Isolation: no local control depends recent Deco or ASUS firmware
OpenWrt: new SSID, interface and firewall zone yes yes with an mDNS reflector a router running OpenWrt 24.10 or 25.12
UniFi or Omada: VLAN, SSID and firewall policies yes yes, with a policy built-in mDNS proxy their gateway and access points
Zigbee, Z-Wave, Thread devices Zigbee and Z-Wave have no IP at all; Thread is routed through Home Assistant Thread needs a border router on Home Assistant’s network a radio adapter or a border router

The guest network is built for visitors: internet yes, home network no. TP-Link’s Archer routers, for example, have two checkboxes, “Allow guests to see each other” and “Allow guests to access your local network”. Leave the second unticked and the plug is isolated from Home Assistant too, so only cloud control is left; tick it and you are back to one network. Fine for devices that only ever talk to their cloud.

A router’s “IoT network” needs its fine print read. TP-Link’s Deco app (More, IoT Network) creates a second SSID with its own band and security, but TP-Link says it “allows cross-network communication by default”. Separation is a different setting, Device Isolation, and TP-Link’s knowledge base warns that isolated devices can no longer be seen or controlled locally by non-isolated hubs and controllers. ASUS added an IoT Network in firmware 3.0.0.6.102_34946 (under Network); its “Use same subnet as main network” option is on by default, and ASUS recommends turning it off for a dedicated IoT network. Its page does not say what then crosses between the two, so run the checks at the end.

OpenWrt gives you all of it: a second SSID, its own subnet and firewall zone, and rules as fine as you like. The script below does it in one go. Check your router in OpenWrt’s Table of Hardware first.

UniFi (Network 9.0 and later on a UniFi gateway) has zone-based firewalling. The quick route is “Network Isolation” on the IoT network (Settings, Networks), which blocks traffic between VLANs in both directions. For Home Assistant to reach the devices, put the IoT network in a zone of its own, block that zone to Internal, and add an Allow policy from Internal to it with “Auto Allow Return Traffic”. Ubiquiti warns that AirPlay and screen mirroring may need the receiver to open connections back, which a reply-only policy refuses. The gateway’s mDNS Proxy repeats discovery between VLANs; an Express or UXG Lite handles 2 networks, an Express 7 30, a Cloud Gateway Ultra 50. On the US store on 29 November 2026 the Cloud Gateway Ultra was $129 ($142 with the surcharge the store adds; it has no Wi-Fi, so add an access point) and the UniFi Express 7, a gateway with Wi-Fi 7, $199 ($219).

Omada gateway ACLs (Network Config, Security, ACL, Gateway ACL) permit everything that no rule denies, so you write a LAN->LAN deny from the IoT network to the main one. The ACLs are stateful, and TP-Link’s own example uses exactly such a one-way deny to stop restricted VLANs starting connections back. mDNS rules live under Network Config, General Settings, mDNS.

Radios that never touch Wi-Fi are the cleanest separation. Zigbee and Z-Wave devices have no IP address; they talk to a coordinator plugged into Home Assistant, so a hacked bulb can reach other Zigbee nodes and the coordinator, not your NAS. (Network-attached coordinators exist; put those on the LAN, next to Home Assistant.) Thread is different: it is an IPv6 mesh, and a border router gives it two-way IP connectivity with your Wi-Fi and Ethernet network. Thread devices are as close to your LAN as the border router makes them, and your router’s firewall does not stand in between. Not every radio is a boundary, though: X10 obeys any command on the wiring.

Which to pick. OpenWrt router, or one that can run it: the script below. UniFi or Omada already: VLAN plus policies. A Deco or an ASUS: their IoT network with isolation, after checking what Home Assistant still reaches. Only a basic ISP router: the guest network for cloud-only gadgets, and Zigbee or Z-Wave for the rest.

Where Home Assistant goes

On the LAN is simplest, and with LAN-to-IoT allowed it reaches most devices. ESPHome is a good case: Home Assistant opens the connection to the device (port 6053), so it just works. Devices that report in by connecting to Home Assistant, such as MQTT devices publishing to Mosquitto on port 1883, need a pinhole: set MQTT_BROKER in the script. Discovery needs the reflector below, or add devices by IP.

With a leg on the IoT network too, for Matter over Wi-Fi. Home Assistant’s Matter documentation says Matter devices that use Wi-Fi must be on the same VLAN as Home Assistant, and Thread-only devices need at least one Thread border router connected to Home Assistant’s LAN. With the script, move one router port into the IoT bridge (below) and plug a second network adapter of the Home Assistant machine into it. On a VLAN-tagged network, Home Assistant OS can add a VLAN interface: ha network vlan eth0 10 --ipv4-method auto. Then look at the network adapter setting under Settings, System, Network: left on auto, Home Assistant’s discovery uses only the adapter its route to the mDNS address goes through. The price: IoT devices can then reach Home Assistant itself, so keep it updated and its passwords strong.

The OpenWrt setup

The current release is OpenWrt 25.12.6 (18 October 2026); 24.10.8 is the old stable, which “will still receive limited security and bug fixes for some time”. The script is written for both.

Before you start, save the current settings and copy the file off the router: tar -czf /tmp/config-before.tar.gz /etc/config. Work from a wired connection, because the reload at the end restarts networking. Log in with ssh root@192.168.1.1, type cat > /tmp/iot-network.sh, paste the script, press Ctrl-D, change the values at the top with vi /tmp/iot-network.sh, then run sh /tmp/iot-network.sh.

iot-network.sh

#!/bin/sh
# iot-network.sh: a separate 2.4 GHz Wi-Fi network and firewall zone for smart-home devices, on OpenWrt 24.10 or 25.12.
# IoT devices get the internet plus DHCP and DNS from the router, and nothing on your LAN; the LAN can still reach them.
# Run it once on the router as root: sh iot-network.sh. Running it again replaces what it made. geekcowboy.net, 2026. MIT licence.
set -eu

SSID='home-iot'
KEY='change-this-passphrase'     # WPA2 passphrase, 8 to 63 characters
ADDR='192.168.30.1/24'           # the router on the IoT network; pick a range nothing else in the house uses
MQTT_BROKER=''                   # e.g. '192.168.1.10': lets IoT devices publish to Home Assistant's MQTT broker on the LAN
NO_WAN_MAC=''                    # e.g. 'aa:bb:cc:dd:ee:ff': one device that gets a fixed address and no internet
NO_WAN_IP='192.168.30.20'        # the fixed address it gets

if [ ${#KEY} -lt 8 ] || [ ${#KEY} -gt 63 ]; then echo "KEY must be 8 to 63 characters" >&2; exit 1; fi

RADIO=''                         # the 2.4 GHz radio: plenty of smart-home devices have nothing else
for r in $(uci show wireless | sed -n 's/^wireless\.\([^.=]*\)=wifi-device$/\1/p'); do
  if [ "$(uci -q get "wireless.$r.band")" = 2g ]; then RADIO=$r; break; fi
done
[ -n "$RADIO" ] || { echo "no 2.4 GHz radio (band '2g') in /etc/config/wireless" >&2; exit 1; }

del() { uci -q delete "$1" || true; }  # remove what an earlier run made; a missing section is fine

# The network: an empty bridge the Wi-Fi joins (a wired port can join it later), with its own subnet.
del network.iot_dev
uci set network.iot_dev=device
uci set network.iot_dev.type=bridge
uci set network.iot_dev.name=br-iot
del network.iot
uci set network.iot=interface
uci set network.iot.proto=static
uci set network.iot.device=br-iot
uci set network.iot.ipaddr="$ADDR"
uci set network.iot.ip6assign=64       # IPv6 from the router's own ULA prefix, and from your ISP's if it delegates one

# DHCP for IPv4, router advertisements (SLAAC) for IPv6.
del dhcp.iot
uci set dhcp.iot=dhcp
uci set dhcp.iot.interface=iot
uci set dhcp.iot.start=100
uci set dhcp.iot.limit=150
uci set dhcp.iot.leasetime=12h
uci set dhcp.iot.ra=server

# The Wi-Fi: WPA2 with AES (CCMP) only, which cheap devices join more reliably than WPA3 or a WPA2/WPA3 mix.
del wireless.iot
uci set wireless.iot=wifi-iface
uci set wireless.iot.device="$RADIO"
uci set wireless.iot.mode=ap
uci set wireless.iot.network=iot
uci set wireless.iot.ssid="$SSID"
uci set wireless.iot.encryption=psk2+ccmp
uci set wireless.iot.key="$KEY"
# A fresh install has its radios off, each with an open network called OpenWrt on the LAN. If this radio is off,
# switch on the IoT network only: whatever else is on the radio stays off the air.
if [ "$(uci -q get "wireless.$RADIO.disabled")" = 1 ]; then
  for i in $(uci show wireless | sed -n "s/^wireless\.\([^.=]*\)\.device='$RADIO'$/\1/p"); do
    [ "$i" = iot ] || uci set "wireless.$i.disabled=1"
  done
  uci set "wireless.$RADIO.disabled=0"
fi

# The firewall zone: nothing in by default, nothing forwarded by default.
del firewall.iot
uci set firewall.iot=zone
uci set firewall.iot.name=iot
uci add_list firewall.iot.network=iot
uci set firewall.iot.input=REJECT
uci set firewall.iot.output=ACCEPT
uci set firewall.iot.forward=REJECT

# IoT to the internet: allowed. LAN to IoT: allowed. IoT to LAN: no forwarding, so blocked.
# Replies to connections the LAN opened get through anyway: fw4 accepts established and related traffic.
del firewall.iot_wan
uci set firewall.iot_wan=forwarding
uci set firewall.iot_wan.src=iot
uci set firewall.iot_wan.dest=wan
del firewall.lan_iot
uci set firewall.lan_iot=forwarding
uci set firewall.lan_iot.src=lan
uci set firewall.lan_iot.dest=iot

# What IoT devices may ask of the router itself: DHCP, DNS, IPv6 neighbour discovery, and mDNS for a reflector.
del firewall.iot_dhcp
uci set firewall.iot_dhcp=rule
uci set firewall.iot_dhcp.name=Allow-DHCP-IoT
uci set firewall.iot_dhcp.src=iot
uci set firewall.iot_dhcp.proto=udp
uci set firewall.iot_dhcp.dest_port=67
uci set firewall.iot_dhcp.family=ipv4
uci set firewall.iot_dhcp.target=ACCEPT
del firewall.iot_dns
uci set firewall.iot_dns=rule
uci set firewall.iot_dns.name=Allow-DNS-IoT
uci set firewall.iot_dns.src=iot
uci add_list firewall.iot_dns.proto=tcp
uci add_list firewall.iot_dns.proto=udp
uci set firewall.iot_dns.dest_port=53
uci set firewall.iot_dns.target=ACCEPT
del firewall.iot_nd
uci set firewall.iot_nd=rule
uci set firewall.iot_nd.name=Allow-ND-IoT
uci set firewall.iot_nd.src=iot
uci set firewall.iot_nd.proto=icmp
uci set firewall.iot_nd.family=ipv6
for t in router-solicitation neighbour-solicitation neighbour-advertisement; do
  uci add_list firewall.iot_nd.icmp_type=$t
done
uci set firewall.iot_nd.target=ACCEPT
del firewall.iot_mdns
uci set firewall.iot_mdns=rule
uci set firewall.iot_mdns.name=Allow-mDNS-IoT
uci set firewall.iot_mdns.src=iot
uci set firewall.iot_mdns.proto=udp
uci set firewall.iot_mdns.dest_port=5353
uci set firewall.iot_mdns.target=ACCEPT

# Optional pinhole: IoT devices may open MQTT connections to one broker on the LAN, and nothing else there.
del firewall.iot_mqtt
if [ -n "$MQTT_BROKER" ]; then
  uci set firewall.iot_mqtt=rule
  uci set firewall.iot_mqtt.name=Allow-MQTT-IoT
  uci set firewall.iot_mqtt.src=iot
  uci set firewall.iot_mqtt.dest=lan
  uci set firewall.iot_mqtt.dest_ip="$MQTT_BROKER"
  uci set firewall.iot_mqtt.proto=tcp
  uci set firewall.iot_mqtt.dest_port=1883
  uci set firewall.iot_mqtt.target=ACCEPT
fi

# Optional: one device with a fixed address and no internet at all (matched by MAC, so IPv6 is blocked too).
del dhcp.iot_nowan
del firewall.iot_nowan
if [ -n "$NO_WAN_MAC" ]; then
  uci set dhcp.iot_nowan=host
  uci set dhcp.iot_nowan.name=iot-nowan
  uci set dhcp.iot_nowan.mac="$NO_WAN_MAC"
  uci set dhcp.iot_nowan.ip="$NO_WAN_IP"
  uci set firewall.iot_nowan=rule
  uci set firewall.iot_nowan.name=Block-WAN-IoT-device
  uci set firewall.iot_nowan.src=iot
  uci set firewall.iot_nowan.dest=wan
  uci set firewall.iot_nowan.src_mac="$NO_WAN_MAC"
  uci set firewall.iot_nowan.proto=all
  uci set firewall.iot_nowan.target=REJECT
fi

uci commit
service network reload
service odhcpd restart
service dnsmasq restart
service firewall restart
echo "IoT network '$SSID' on $RADIO, router at $ADDR. Check it from both sides before you move devices over."

What it does

  • A bridge with no ports, br-iot, and an interface iot on it at 192.168.30.1/24, with IPv6 from the router’s ULA prefix. The Wi-Fi network joins the bridge; a wired port can join later.
  • DHCP hands out 192.168.30.100 to .249; IPv6 devices configure themselves from router advertisements.
  • The SSID goes on whichever radio has band '2g', with WPA2 and AES only. If that radio was switched off, as on a fresh install, the script switches it on with only the IoT network on it, so the open default network called OpenWrt does not go on the air with it.
  • The iot zone rejects everything aimed at the router except DHCP, DNS, IPv6 neighbour discovery and mDNS, so the admin page and SSH are out of reach. Forwardings allow IoT to WAN and LAN to IoT; there is none from IoT to LAN, so that traffic is rejected. fw4 accepts established and related traffic before any zone rule, which is the “replies” row of the policy.
  • The optional rules sit ahead of the internet forwarding: the MQTT pinhole to one address and port, and a block on one device’s MAC address. Matching the MAC rather than the IPv4 address also blocks the device’s IPv6 traffic.

If nothing on the IoT SSID needs to talk to anything else there, uci set wireless.iot.isolate=1 stops Wi-Fi clients reaching each other as well. Leave it off if a hub and its accessories, or a Matter controller, share that SSID.

To give Home Assistant (or a wired camera) a port on the IoT network, move one LAN port into the bridge. These commands find the br-lan device and move lan4; check your port names with uci show network first:

BR=$(uci show network | sed -n "s/^network\.\([^.]*\)\.name='br-lan'$/\1/p")
uci del_list "network.$BR.ports=lan4"
uci add_list network.iot_dev.ports=lan4
uci commit network
service network reload

Discovery across the two networks

Phones, Home Assistant and casting mostly find devices with mDNS, which uses the link-local multicast address 224.0.0.251 (FF02::FB for IPv6), port 5353. Link-local means routers do not pass it on, so a reflector on the router has to repeat it. avahi does that on OpenWrt:

opkg update && opkg install avahi-nodbus-daemon     # OpenWrt 24.10
apk update && apk add avahi-nodbus-daemon           # OpenWrt 25.12

In /etc/avahi/avahi-daemon.conf, add allow-interfaces=br-lan,br-iot under [server] and change enable-reflector=no to yes under [reflector], then /etc/init.d/avahi-daemon enable and /etc/init.d/avahi-daemon restart. The script’s mDNS rule already lets the queries in. avahi’s manual warns against running two reflectors between the same networks (“Ping Pong with mDNS packets”), and reflect-filters= limits which services are repeated.

What a reflector does not cover:

  • SSDP, UPnP’s discovery protocol (239.255.255.250, port 1900), is not mDNS, and avahi ignores it. Add those devices by IP address, or keep them next to whatever controls them.
  • Casting finds the device by mDNS (Google says ordinary Chromecasts rely on it), and Google’s enterprise guidance has senders connect to receivers on TCP ports 8008 and 8009, which LAN-to-IoT allows. Some services need the receiving device to open connections of its own, which IoT-to-LAN blocks; Ubiquiti names AirPlay and screen mirroring. If casting to a TV or speaker breaks, put that one on the LAN.
  • Matter and Thread. Matter relies on local IPv6 and mDNS. Home Assistant says no IPv6 internet connection or DHCPv6 server is needed, but its Matter documentation still wants Matter Wi-Fi devices on Home Assistant’s own VLAN, and a reflector does not change that. Thread border routers announce their routes to the Home Assistant host, so Home Assistant and at least one border router share a network. While commissioning a Matter device with your phone, Home Assistant wants the phone on the same 2.4 GHz network as the device: join the phone to the IoT SSID for that.

2.4 GHz, WPA2 and WPA3

TP-Link puts it plainly: many IoT devices require 2.4 GHz. Espressif’s ESP8266, for example, does 802.11 b/g/n at 2.4 GHz and nothing else; its newer ESP32-C5 adds 5 GHz. A 2.4 GHz-only IoT SSID with its own name also removes a classic pairing failure, which TP-Link gives as a reason for its IoT network: the phone on 5 GHz under the same name, the device unable to follow.

For security, Apple recommends WPA3 Personal, WPA2/WPA3 Transitional “for compatibility with older devices”, and WPA2 Personal (AES) when you can use neither. Keep WPA3 on your main network. On the IoT SSID the script uses WPA2 with AES (psk2+ccmp); once everything there has joined, you can try sae-mixed (WPA2/WPA3) and see whether it all comes back. Never “None”, even though some routers offer it for IoT networks.

Fixed addresses

Give a device a fixed address when Home Assistant reaches it by IP, or when a rule names it. Use addresses below .100, outside the DHCP pool:

uci add dhcp host
uci set dhcp.@host[-1].name='plug-kitchen'
uci set dhcp.@host[-1].mac='aa:bb:cc:dd:ee:01'
uci set dhcp.@host[-1].ip='192.168.30.21'
uci commit dhcp
service dnsmasq restart

Then reconnect the device (power-cycling it does that) so it asks for the new address.

Check it from both sides

Join a laptop to the IoT SSID (here with the LAN on 192.168.1.0/24 and a NAS at 192.168.1.20; on a Mac, ipconfig getifaddr en0 replaces the first line):

ip -4 addr                                  # an address between 192.168.30.100 and .249
nslookup example.com 192.168.30.1           # the router answers DNS
curl -sI https://example.com | head -1      # the internet works
ping -c 3 192.168.1.20                      # the NAS: "Destination Port Unreachable"
nc -vz -w 3 192.168.1.20 445                # its file sharing: connection refused
curl -m 5 http://192.168.30.1               # the router's web interface: connection refused

Then from a computer on the LAN: ping an IoT device’s address, and check that Home Assistant still shows every device and that the phone apps still control them. To learn which apps work locally and which only through the cloud, unplug the router’s internet cable for a minute and try again.

On the router, nft list chain inet fw4 forward_iot shows the rules with their counters. To watch what the zone rejects, turn on its logging, limited to 10 lines a minute so a chatty device cannot flood the log:

uci set firewall.iot.log=1 && uci set firewall.iot.log_limit=10/minute
uci commit firewall && service firewall restart
logread -f -e 'reject iot'

A device trying to reach your LAN shows up as reject iot forward. Turn logging off again with log=0 once you have looked.

How this was tested

The script, the port move and the avahi install ran in OpenWrt’s official Docker images for 24.10.8 and 25.12.6, on a copy of a typical dual-band router’s configuration. uci accepted everything, a second run changed nothing, and bad input was refused without touching the configuration. fw4 rendered the firewall, and its IoT chains match the policy table line by line. Checking that ruleset against the kernel (nft -c) and the reloads at the end were not possible in the container, and nothing was run on a real router or over Wi-Fi. The tested box at the top has the exact list.

Sources