A VLAN for two devices isn't overkill

Symptom

Networks added one at a time with no plan: a lab subnet inside Docker’s default address pools, storage on the management network, IoT in a zone that allowed everything

Cause

Nothing had been designed, and the obvious shortcut for isolating a device, a gateway firewall rule on a shared subnet, never sees the traffic it is meant to stop

Halfway through planning this, I asked the question I expect from readers: why build a whole network for a work laptop and a work phone? Give them fixed IPs, write a firewall rule, done.

That doesn’t work. The gateway’s firewall only sees traffic that crosses between subnets. Two devices on one subnet talk straight through the switch or access point, and no gateway rule ever sees it. Put my work laptop on the trusted network with a rule for it and it can still reach every Mac, phone and speaker there.

So the work devices got their own network, and so did everything else, by role. Between 2026-10-30 and 2026-11-08 I moved the house onto the new design and deleted the old networks. Claude Code did most of it through the UniFi Network API from my Mac mini. I did the rest by hand: the Cloudflare tunnel routes, the mDNS proxy and, later, the IPS settings, both WireGuard servers, the NAS’s NFS permissions, and every check that needed a phone or my eyes.

Afterwards I had a separate Claude session review the plan and the log. Its verdict was that the migration worked and its weak point was verification: our checks proved hosts answered, not that they worked. Where this post judges what went well and what didn’t, it leans on that review; the durations and who-found-what below come from going back through the session transcripts, which the review didn’t have.

What I started with

Every network had been added to solve whatever was in front of me at the time; “nothing really was done with any intention.” The lab subnet sat inside Docker’s default address pools. The NAS shared the default network with the switches and APs (that cost me most of a 10G link). And IoT sat in UniFi’s Internal firewall zone, which allows everything inside itself: the zone firewall existed, and for IoT it enforced nothing.

The design

One network per role, each its own firewall zone, deny between zones by default. Every subnet has the same layout: gateway first, then fixed addresses for infrastructure, a reserved block, and DHCP.

NetworkHolds
ManagementUniFi gear only
HypervisorsProxmox nodes, a quorum device, KVMs
ServersStorage, DNS, Home Assistant, self-hosted services
DMZAnything reachable from outside
TrustedOur computers, phones, Apple TVs, Sonos
IoTCameras, bulbs, switches, printer, TV
Guest, Work, Lab, VPNWhat they say

Trusted and the admin VPN get admin access. Everything else gets only the allows it needs, each written down with its reason: 35 allows and 17 blocks of my own on top of UniFi’s defaults. The exceptions are deliberate and few: Home Assistant reaches into IoT, the Mac mini keeps admin access from Servers, and the work VPN, which lands in UniFi’s fixed VPN zone, is walled off with explicit block rules ahead of that zone’s allows.

Firewall zones and their exceptions Eleven networks, each its own firewall zone. Trusted and the admin VPN have admin access to every network. Home Assistant on Servers and the IoT network reach each other, and IoT uses DNS on Servers. DMZ reaches DNS and one app on Servers. Hypervisors reach storage on Servers, and the Mac mini on Servers has admin access back. The work laptop on the Work network reaches two hosts on Servers. The work VPN is walled off. Management, Lab and Guest have no exceptions drawn. Trusted Admin VPN admin access to every network Management Hypervisors Lab storage Mac mini: admin IoT Servers DMZ HA DNS DNS, 1 app laptop: 2 hosts Guest Work Work VPN walled off No arrow: denied. Each network is its own zone.
Traffic between zones is denied unless an arrow says otherwise. These are the main exceptions, not every rule. Work, highlighted, is the two-device network this post defends.
  • No Wi-Fi change anyone would notice. No SSID names or passwords changed, because re-pairing bulbs one app at a time is the part of a migration nobody wants. Both IoT SSIDs (renamed Sumatra and Reserve in these posts) just map to the new IoT network.
  • No camera network. The cameras and their recorder stay together on IoT.
  • Work devices get a network, not rules. Client isolation can stop same-subnet traffic too, but on a shared trusted network it has to be on every port and SSID, and it breaks the discovery the rest of the house relies on: AirPlay, Sonos, the printer. With a Work network, the work password lands on Work wherever the laptop joins, and only a couple of wired ports have to be right. Client isolation is also on for that SSID, which guests share. The laptop gets the internet plus SSH and a few dev ports on two machines, and since it has three network adapters, the rule’s source is an IP group, not one address.

How it was executed

I couldn’t do this in one sitting, so the plan ran as numbered sessions, each the smallest unit that has to be finished once started, with the network fully working between any two.

Nothing was cut over. All the new networks were created up front, empty, beside the old ones. Temporary firewall rules kept old and new talking, so “half the servers moved” was a stable state, and the plan named the step that would remove each one. All were removed.

The helper was dry-run by default. Claude wrote unifi.py for repeated calls: every write needs --apply. The gateway’s certificate is self-signed and not a CA, so it can’t be a trust anchor; the helper pins its fingerprint, recorded on first use and checked against the browser, and refuses to send the API key on a mismatch:

got = fingerprint(conn.sock.getpeercert(binary_form=True))
if got != want:
    conn.close()
    sys.exit(f"TLS pin mismatch for {u.hostname}: got {got}, pinned {want}. Not sending the API key.")

It only covered DNS records and client settings, though. Firewall policies, switch ports, SSID mappings, DHCP settings and the networks themselves went through one-off API calls. Changing one switch port, for instance, means sending back that switch’s entire port-override array.

Writes were read back by hand, though nothing enforced it. A PUT rest/setting/mdns returned success and changed nothing, and so, at the very end, did PUT rest/setting/ips; I did both in the UI. Saving the device SSH key setting also silently regenerated an unrelated internal API token.

Mechanisms were proven on throwaway targets first. One session checked that a DHCP reservation could be set on a network the client hadn’t joined yet, that a per-client override moves a Wi-Fi plug, and that a throwaway container on Lab reached the internet and nothing internal. That last test found Lab could still reach the gateway’s admin page; the block was extended to the new zones the same day.

Risky moves had a rollback timer. When a change could cut off the machine making it, a timer was armed first and cancelled from the new address once checks passed. It fired twice. One server’s move rolled back after 2 minutes because disabling its switch port didn’t drop the link, so it never renewed its address. Home Assistant’s rolled back after 3.5 minutes. The fix for the first, forcing the port’s link speed and then restoring autonegotiation, worked on the NAS, the Mac mini and the camera recorder, and failed on Home Assistant, which seems to have kept its lease through the bounce. It moved on the second try with a reboot.

Some plan steps got compressed at my request. The overnight soak for the new cluster link ran 36 minutes, because both links shared the same cables and switches and nothing had dropped. IoT moved in one run instead of batches. Each worked.

What broke, and who noticed

Some checks asked the right question and caught breaks inside the session: Proxmox metrics after a server moved, a TV tuner the media server showed as dead, and Home Assistant losing the camera recorder. The breaks that got through were the ones where a check confirmed a host answered and something behind it had stopped working.

What brokeHow longSurfaced by
Two media apps reached their download client by its old address; both reported it failingAbout six hours, overnightMe
The download client rejected its new hostname, breaking a dashboard cardNot recordedA parallel Claude session
A stats service still pointed at the media server’s old address; the plan had assumed a nameAbout an hourLater work that evening
The mini’s Apple content cache stopped serving clients on another subnetA few hours, silentlyMe, asking whether it still worked

After the dashboard change, Claude’s check confirmed the dashboard loaded, not that each service behind it accepted the new hostname. The media apps flagged the broken download client in their own health status for about six hours, and no check looked there. The plan listed addresses held in config files, mounts, SSH configs and several app settings, but not the ones inside the media apps. And the topology change itself broke things: separating hosts from their clients broke the content cache’s local-subnets-only flag, and consolidating servers into one /24 put them all under the DNS filter’s per-/24 rate limit.

The last step

One step in the plan remained after the old networks were gone: on 2026-11-09, renumbering Management into the scheme.

The prep found two traps. Every UniFi device reported to the gateway’s old management address, which was about to disappear. And with day-long DHCP leases, a device could sit on its old address, out of reach, until the next day. So the devices got an SSH key, leases dropped to five minutes, and renewals were forced over SSH. Four models have no usable SSH and stayed on long leases.

The cautious path was to repoint one access point by hand, then turn on UniFi’s inform-host override, then renumber. I chose to test whether UniFi would repoint the devices itself, with SSH and saved port snapshots as the fallback. It did. Within about two and a half minutes all 14 devices were connected on their new addresses, most keeping their last octet, the four without SSH included. The 5G backup’s link subnet moved on its own. None of the fallbacks were needed, and the Mac mini, talking to the gateway through its Servers address, kept its connection throughout. That’s one observation on one controller, not a promise, and the bet was hedged: the fallbacks were already in hand, and the check afterwards asked whether every device connected and every service I tried still answered.

Where it stands

On 2026-11-08 the seven old networks were deleted one at a time through the API, after a backup and a redacted inventory. Every device reconnected. Proxmox quorum held through moving both nodes’ cluster link and management addresses, and backups ran cleanly afterwards.

Isolation was tested from inside in two places: Lab, from a throwaway container, and the work VPN, from a café, where a hypervisor didn’t answer by name or address. The gateway’s admin block was tested from Servers and Hypervisors too. Isolation from inside IoT, Guest and Work is asserted, not tested: the rules say they can’t reach the rest of the house, and nobody has tried from a device on them. The work laptop’s one deny test was against a host I later allowed it to reach. The TV’s no-internet rule has never been seen blocking anything.

I turned IPS off on 2026-10-31 when it appeared to stall SSH to the new hypervisor network; no IPS event ever confirmed that. It was re-enabled on 2026-11-09 in detect-only mode, on the networks that face outside or hold devices I don’t control. Storage traffic between the hypervisors and the NAS crosses the gateway, and inspecting it would cost CPU for little gain. Gateway CPU went from about 39% to 58% as the engine started. Blocking waits on a week of alerts reviewed for false positives.

Raw reads printed secrets into the session transcript four times, the worst being the full site settings. None reached the repo. After the work I replaced the DNS API token, changed the device SSH password and turned off an unused RADIUS server; another secret had been regenerated along the way, and one died with its server. The rest I left on purpose.

Next time

These are the review’s recommendations, trimmed to the ones I’d act on.

  1. Ask each app for its own health, before and after. Media apps report failing download clients, Prometheus knows which targets are down, and comparing Home Assistant’s unavailable count to a baseline worked well here. One command, diffed.
  2. Map dependencies from the apps, not the files. Before a host moves, list who calls it and where each stores the address.
  3. Test the firewall from inside every network. The Lab container works on any network a hypervisor carries.
  4. Redact at the output layer. Redaction lived in one command, so every other read printed raw, and the leak recurred three times after the first fix.
  5. Put every write behind the helper, with a dry run, a saved before-object and a read-back, and keep that rollback data somewhere backed up rather than in a session’s scratch folder.
  6. End with a closing session: scope down the access the migration created, settle anything that leaked, finish IPS, and write an as-built document from a fresh inventory.

If I ever package these helpers as a reusable UniFi admin library, items 4 and 5 are where it starts.


Network names, SSIDs and addresses are described rather than printed. Counts, durations and test results come from the session log and transcripts kept during the work; the policy counts are from the API inventory taken before the old networks were deleted. Versions are what the gateway reported on 2026-10-30.