Skip to content

Network groundwork

Only what the virtual machines need from the network before they can exist: a fast link between the router and the switch, the list of networks with one new VLAN, the Mac mini’s switch port carrying the VMs’ VLANs, and the local accounts the services sign in with. Nothing here restricts any traffic. The firewall zones and the rest of the audit’s fixes come in chapter 10, once every service runs in its final place, so each restriction is tested against the real setup.

It is written for UniFi Network 11. Menu labels move a little between releases. If a label differs, the setting is in the same section under a nearby name.

Restore or from scratch. On the existing UDM Pro you check each network and change what differs: that is the restore path, and step 2.7 is its safety net. On a factory-reset console you create every network as listed: the tables give every value, so the same steps serve both.

Work from a computer wired to the Default network (10.0.1.0/24).

Why. Every rollback in this chapter is “restore the backup from step 2.7”, so make sure it exists, and note the version the labels below were written for.

UniFi Settings > System (or UniFi OS Settings > Control Plane > Updates): note the Network version. Settings > System > Backups: confirm a backup dated today is listed, and that ~/infra-migration/backups/unifi-before.unf is on the Mac.

Verify. Network is 11.0 or later, and ls -l ~/infra-migration/backups/unifi-before.unf shows today’s date.

Rollback. None needed.

Why. The switch reaches the UDM Pro through port 1, and ports 1 to 8 of the UDM Pro share one internal 1 Gbps link. All routing between VLANs squeezes through it, which caused more than 600,000 receive errors. The SFP+ ports on both devices are free. A DAC cable runs cool, unlike copper 10G modules.

UniFi

  1. UniFi Devices > USW Pro 24 > Port Manager > port 25: enabled, native network Default, tagged VLANs Allow All.
  2. UniFi Devices > UDM Pro > Port Manager > port 11 (SFP+ LAN): network Default, all VLANs allowed.
  3. Plug the DAC cable into UDM Pro port 11 and switch port 25. Wait 30 seconds. Both ports show 10 GbE. Spanning tree blocks one of the two paths, so nothing loops.
  4. Unplug the cable between UDM Pro port 1 and switch port 23.
  5. Wait until the switch is Online again.

Verify. The topology view shows the switch uplink as UDM Pro port 11 at 10 GbE. From the Mac, ping -c 20 10.0.1.1 loses no packet.

Rollback. Plug port 1 and port 23 together again. If the switch did not come back within 3 minutes, check that port 25’s native network is Default.

Why. One VLAN per level of trust lets the firewall treat each level differently. Whether a device uses a cable or Wi-Fi does not change what it may reach, so there is one network for your own devices (Trusted) and one for IoT (R10). Every VLAN ID equals the third number of its subnet (R11). The first ten addresses of every subnet are kept for services with a fixed address, so no DHCP pool may start below .11. The Standby network is new: it isolates the standby VM (J8), on VLAN 6 (R12).

UniFi Settings > Networks. Check each row, or create it with New Virtual Network:

Name VLAN ID Gateway and subnet DHCP range IGMP snooping
Default 1 10.0.1.1/24 10.0.1.11 to 10.0.1.254 on
Servers 2 10.0.2.1/24 10.0.2.11 to 10.0.2.254 on
Surveillance 3 10.0.3.1/24 10.0.3.11 to 10.0.3.254 on
IoT 4 10.0.4.1/24 10.0.4.11 to 10.0.4.254 off
Trusted (named WiFi until now: rename it) 5 10.0.5.1/24 10.0.5.11 to 10.0.5.254 off
Work (the work network, switch port 3 only) 7 10.0.7.1/24 10.0.7.11 to 10.0.7.254 on
Standby 6 10.0.6.1/24 DHCP off on
Neighbor_WiFi 100 10.0.100.1/24 10.0.100.11 to 10.0.100.254 on

On the restore path the networks Wired (VLAN 3) and WiFi_IoT (VLAN 6) still exist at this point. Leave them: step 3.4 empties them. Their numbers are reused, so two rows of the table wait. Standby is created at the end of step 3.4, when WiFi_IoT has given up VLAN 6. Surveillance stays on VLAN 8, 10.0.8.1/24 for now and moves to VLAN 3 in step 8.14, when Wired can be deleted.

Leave each network’s DHCP DNS setting as it is today. Step 6.11 changes DNS for the whole house in one go, once the new resolver answers.

IGMP snooping is off on the two networks where HomeKit, AirPlay and Matter discover devices, because snooping is a known cause of lost HomeKit discovery (J23). It stays on elsewhere to keep multicast off ports that do not want it.

On Standby, also turn off Auto-Scale Network, mDNS and IPv6. The standby VM sets its own address.

Verify. The Networks list shows eight networks, numbered 1 to 7 and 100 (on the restore path: nine, with Wired and WiFi_IoT and without Standby, and Surveillance still on VLAN 8, until steps 3.4 and 8.14). In Client Devices, sort by IP address: no client other than a gateway holds an address from .1 to .10 on Trusted, IoT or Servers, except the ones this guide assigns (the NAS and Pi-hole on Servers today). Write down any other, and move it with Fixed IP Address to .11 or higher.

Rollback. Delete the Standby network. Put a DHCP range back to its old start, and the old name back on VLAN 5.

3.4 Fold Wired into Trusted and WiFi_IoT into IoT

Section titled “3.4 Fold Wired into Trusted and WiFi_IoT into IoT”

Why. R10. Two pairs of networks had the same trust level and differed only by cable or radio. Each pair becomes one network, which halves the firewall policies to keep right and lets discovery (AirPlay, HomeKit, printers) work inside one network instead of being reflected between two. Devices move by DHCP on their own: only a device with a hand-set address needs a visit.

From scratch, with no Wired or WiFi_IoT network: skip to step 3.5.

Do this at a quiet hour: each device loses its connection for a few seconds when its port or its Wi-Fi changes network.

UniFi

  1. Note what is pinned. Client Devices, filter on network Wired, then on WiFi_IoT: write down every client with a Fixed IP Address (name, MAC address, address) in ~/infra-migration/fixed-ips.txt. Their reservations are re-created below in the new subnet.
  2. Wi-Fi first. Settings > WiFi > the IoT SSID: Network: IoT in place of WiFi_IoT. Apply. The wireless IoT devices reconnect and take 10.0.4.x addresses within a minute. The SSID’s name and password do not change, so no device has to be joined again.
  3. Then the switch ports. UniFi Devices > USW Pro 24 > Port Manager (and the same on any other switch): select every port whose native network is Wired, except the port of the Mac that runs the Home Assistant VM today, and set Native VLAN / Network to Trusted. That one port stays on Wired until the VM has moved: today’s VM sends its traffic tagged for VLAN 5, and a port cannot carry the same network both tagged and untagged, so changing it now would cut Home Assistant off. The new Mac mini’s port gets its profile in step 3.5. Ports of access points are not touched: they carry all networks tagged.
  4. Reservations. For each line of your note: Client Devices > the device > Settings > Fixed IP Address, the same last number in the new subnet (10.0.3.25 becomes 10.0.5.25, 10.0.6.40 becomes 10.0.4.40). If the number is taken, choose a free one above .10. A device that was set by hand on the device itself (a printer’s own menu, for example) must be changed there, to the new subnet and gateway.
  5. Wait and look. After ten minutes, Client Devices filtered on WiFi_IoT shows no client, and filtered on Wired shows only the old Mac. A device still listed is asleep or pinned by hand: wake it, or restart it.
  6. Delete the network WiFi_IoT in Settings > Networks. UniFi refuses while a port profile, an SSID or a policy still names it, and says which: fix that one and delete again. Wired stays, with the old Mac as its only client, until step 8.14.
  7. Create Standby now that VLAN 6 is free: the row of the table in step 3.3 (VLAN 6, 10.0.6.1/24, DHCP off, Auto-Scale, mDNS and IPv6 off).

The NAS has interfaces tagged for the old networks from the time it ran containers. The one in WiFi_IoT goes dark at this step, and nothing uses it. Its addresses on Servers, Trusted and IoT do not change.

Home Assistant integrations that name a moved device by address (not by name) show it unavailable: Settings > Devices & services, the integration, Reconfigure with the new address. Devices found by discovery come back by themselves. The wake-on-LAN broadcast address 10.0.4.255 in the Home Assistant configuration stays right.

Verify.

Terminal window
ping -c 1 -t 2 10.0.6.1 >/dev/null 2>&1 && echo "10.0.6.1 answers: Standby exists" || echo "no 10.0.6.1: create Standby (sub-step 7)"

The Networks list shows nine networks: WiFi_IoT is gone, Standby holds VLAN 6, and Wired remains with one client. A phone on the main Wi-Fi and a wired computer both hold 10.0.5.x addresses and can reach each other. An IoT device on a cable and one on Wi-Fi both hold 10.0.4.x addresses.

Rollback. Delete Standby, create WiFi_IoT again with the values of your screenshots from step 2.6 (VLAN 6, 10.0.6.1/24), and set the SSID and the ports back.

Why. UTM bridges the VMs onto the Mac’s Ethernet port. The Mac and the home VM live in the Trusted network and send untagged, and each VM adds a VLAN tag for any other network it uses. The switch port therefore carries Trusted untagged, plus the three VLANs the VMs tag. Nothing else is allowed on that port.

UniFi UniFi Devices > USW Pro 24 > Port Manager, the port the Mac mini is plugged into:

Setting Value
Native VLAN / Network Trusted (5)
Tagged VLAN Management Custom: Servers (2), IoT (4), Standby (6)
Link speed Auto-negotiate
Spanning tree on
Storm control, loop protection off on this port. The VMs send multicast that storm control can mistake for a storm

Verify. The port’s row shows Trusted as native and three tagged networks. Final proof comes in step 5.14, when a VM answers on its VLAN.

Rollback. Set Tagged VLAN Management back to its previous value (the old setup used Allow All) and the native network to its previous one.

Why. UnPoller, Scrypted, Home Assistant and Insights Plus sign in to the UDM Pro. Cloud accounts with two-factor sign-in do not work for them, and a dedicated local account per use can be removed without touching yours.

UniFi UniFi OS Admins & Users > Add Admin, each with Restrict to local access only:

Account Role Used by
unpoller Network: View Only. Protect: none UnPoller (skip if step 2.13 already stored the existing one)
protect-local Protect: Full Management. Network: none Scrypted and Home Assistant’s UniFi Protect integration
insights Network: View Only Insights Plus, through an API key

For the API key: sign out, sign in as insights at https://10.0.1.1, then Network > Settings > Control Plane > Integrations > Create API Key. Copy it once.

Mac

Terminal window
op item create --vault Infrastructure --category login --title "UniFi local admin protect" \
username=protect-local --generate-password='letters,digits,32'
op item create --vault Infrastructure --category "API Credential" --title "UniFi API key insights" \
'credential[password]=PASTE_THE_KEY_HERE'

Create the unpoller item the same way if step 2.13 did not. Generate each password in 1Password first, then paste it into the UniFi form, so the two always match.

Verify. In a private browser window, https://10.0.1.1 accepts protect-local and shows Protect only. op read "op://Infrastructure/UniFi API key insights/credential" | wc -c prints more than 20.

Rollback. Delete the admin in Admins & Users and the item in 1Password.

The network behaves exactly as before. The switch talks to the router at 10 Gbps, the Standby network exists on VLAN 6, your own devices share one Trusted network and the IoT devices another, the Mac mini’s port carries the three VLANs the VMs will tag, and three local accounts wait in 1Password.