Separating IoT from the Home Network
Cameras, thermostats, an EV charger, an inverter: devices that talk to someone else's cloud currently sit next to my servers and NAS. The project to isolate them on a separate network, using the router's firewall, without breaking the home automation.
The problem
My home network has grown in layers: servers, a NAS, Raspberry Pis, PCs, and in the middle of it all twelve cameras, seven thermostats, an electric-car charger, a solar inverter, voice assistants and assorted gadgets. They’re all devices that talk to their manufacturer’s cloud, get updates when and how the manufacturer decides, and that none of us really controls. Yet today they share a network with my passwords, backups and family photos. If one of them were compromised, it would have a clear road to everything else.
The goal is easy to state: one network for the things I trust and one for the things I don’t, with the firewall deciding who can talk to whom.
Before touching anything, take stock
The first part of the work was a precise inventory, drawn from the home DNS server’s exports and a walk through the rooms: what’s there, where it is, how it’s connected. It holds the usual surprises of a real house: a cheap unmanaged switch at the core, a second building reached by a cable under the courtyard, an apartment linked only by powerline, and a spot in the house where a cable simply can’t reach. All of it sits in a private repository, with floor plans and photos, so later decisions start from facts.
How I decided to do it
- A free port on the router becomes the IoT network. The router has an unused SFP port: with an adapter it becomes the gateway of a second network. Isolation doesn’t live in router VLANs, it lives in the firewall.
- Wi-Fi is split where needed. The current access points don’t understand VLANs, so for the IoT networks I add access points managed by a cloud controller and a couple of managed switches. Where a cable can’t reach (the kitchen), an access point joins in a wireless mesh.
- What must stay trusted stays trusted: servers, NAS, Raspberry Pis, PCs, printers, but also the TVs, speakers and the apartment of someone who doesn’t want anything to change.
- Progressive migration, one device at a time. With the same final addresses (only the third number changes), so reservations and habits are recognised. The cameras go first; the charger and the inverter move by themselves when the Wi-Fi network’s name changes sides.
- The old Wi-Fi can be retired, but carefully: the new access points also broadcast the home network with the same password and I switch off one old unit at a time, starting with one that has nothing wired to it. A reversible trial, not a leap in the dark.
The firewall, in plain words
The rules are few and readable. For traffic arriving from the IoT network:
- replies to what is already in progress are accepted;
- only the request to the home DNS is accepted (so names resolve and can be filtered);
- there’s a single exception for the charger, which opens a connection to the home automation server;
- everything private is blocked: the home network, the other house’s, the VPN;
- the rest, meaning the Internet, passes.
Towards the router itself from IoT only the address request and ping pass: no administration access. From the trusted network towards IoT, instead, everything is allowed, to watch the cameras locally. And cameras are never exposed to the Internet with a port forward: to see them from outside I go through the VPN I already have.
A trap specific to this router: balancing between the two Internet lines is a rule applied to a single interface. If it isn’t extended to the new one, IoT traffic doesn’t get out; and traffic between the two local networks has to be excluded in both, otherwise it goes round through the provider. Another thing to check is the outgoing address masquerading, which might only apply to the old network.
The home automation mustn’t break
Before deciding I asked what depended on what. My home automation does almost everything through the manufacturers’ clouds: solar panels, weather, thermostats, air conditioners, shutters. Those devices move without changing a line of code. The only real conflict is the charger, which opens a connection to my server: hence the exception above. The server stays on the trusted network, because it does things that belong there (waking PCs, shutting them down, checking the NAS). I also found an outdated address for that server in the system’s configuration, a latent error the project brought to light.
Status
The project is at the design stage: the inventory is complete, the decisions are made and the shopping list is ready (two managed switches, three access points, a few cables, about 400-460 euros in all). I’m waiting for the hardware. The next step is the first phase of the migration: configuring the router (the new interface, DHCP, the firewall rules). A few things remain to verify: whether guest-network devices on the old access points really get their addresses from the home server, the coverage of one camera, and how the VPN’s clients show up to the firewall.
Stack
Ubiquiti EdgeRouter (EdgeOS) · Zyxel Nebula · VLAN · Pi-hole · WireGuard · Raspberry Pi