mullane.info

Swapping the switches

2026-11-21 · network

The three UniFi switches arrived a few days early, and the controller side had been prepared the same week: a network for every zone, port profiles, reservations from the MACs on the labels. Then I got distracted for a couple of days. So on Saturday evening the job was simple on paper: stage each new switch, let the agent adopt it and set its ports, then move the cables floor by floor (downstairs, basement, upstairs) without taking the house offline for more than a few minutes at a time.

The plan had been to stage all three at once, chained off one port of the old basement switch. I didn’t have the outlets for that down there, so it was one at a time, each one plugged into the old switch by its uplink port so that applying the port settings wouldn’t cut the agent off. The first one, the downstairs Pro XG 8, showed no link at all. Zero packets on the old switch’s counter for that port, ever. I unplugged the cable at the new switch, plugged it back in, the lights changed, and from there it was about fifteen minutes of adoption, a firmware update and port profiles. I still don’t know why the first seating didn’t take.

Then came the first real mistake, which was a shared one. I carried the switch downstairs and moved the cables, and out of habit mediarr and video went into the port numbers they’d had on the old five-port switch. The agent saw them land on ports set up for other zones, both offline, and helpfully changed the port settings to match where they were. Meanwhile I’d noticed the table and was moving the cables to match it. So for a few minutes we were each fixing the other’s fix. The agent caught it by reading which MAC was on which port, put the settings back, and everything came up. The lesson there is about as old as networking: give the move as “old port, device, new port”, and look at what’s actually plugged in before changing anything.

While checking the basement, the agent found that monitor (the box that runs Gatus and sends the alerts to my phone) was off. Not hung, off. Its log just stopped at 15:44 the day before, which was when the office breaker tripped and I went to reset it. Desktom went off at the same time on what I’d thought was a different circuit, and came back when I flipped the breaker. monitor didn’t, because its firmware leaves it off after a power loss. So for about 28 hours nothing was watching the network, and nothing told me, because the thing that tells me was the thing that was down. It’s on a to-do list now (a firmware setting, and something outside it that notices when it goes quiet), if a low-priority one, because it lives somewhere rather inconvenient.

The basement swap itself was the boring part, which is the best kind. Thirteen cables moved, every device checked on its planned port by MAC, and the uplinks between floors now run at 10G instead of 1G. Upstairs went last, since desktom is on it: staged off a free port on the old upstairs switch so desktom never dropped, then one cable move and about a minute offline.

A couple of things UniFi taught us along the way. You can’t disable a port with a port profile. The controller accepts “disabled” and stores it as “all”, which means every VLAN, so the unused ports would have been the most permissive ones in the house. The agent caught that by reading the setting back, deleted it, and put unused ports into a dead-end VLAN instead. The other one was mirroring. The plan was to send both the LAN and the WAN into netsec‘s capture port, and it turns out a UniFi mirror session takes exactly one source (the agent went and read the controller’s own UI code to confirm it). So the WAN needs its own capture port, and netsec is a mini PC with no PCIe slot, which I suspected (its chassis doesn’t exactly invite you in). A USB 2.5G adapter it is; it’s on order.

I wanted the WAN part done tonight anyway, so the internet now runs from the ONT through the basement switch to the firewall, on a VLAN of its own that nothing else carries. The mirror half waits for the adapter. The trade-off is that the switch’s firmware updates now take the internet down for a couple of minutes, so those only happen overnight.

Then there was the detour. The agent needed root on two hosts for some checks, which means me unlocking it with my smart card, and that failed: “Could not open a connection to your authentication agent”. Fixing that in one shell was easy. Working out why a new terminal still couldn’t find the agent took a bit longer, and it came down to two things. First, zsh reads exactly one .zshenv, the one in my home directory, which only points zsh at my real config. It never goes back for the .zshenv in that config, so the SSH agent fallback in there had never run, in any shell, ever. Second, I’d been logging in with the plain Hyprland session instead of the one that hands systemd’s environment to the desktop. Either fix alone would have covered it; I had neither. The first is fixed in workbench, and the second is me picking the right line on the login screen.

The other small surprise was the UniFi page not loading in Firefox. Firefox does DNS over HTTPS by default here, which asks Cloudflare, and Cloudflare has never heard of my internal names. An exception for the domain fixed it.

To finish, I asked the agent to clean up the READMEs, which had been collecting history: finished runbooks, struck-through problems, “first backup expected tomorrow” from a week ago. They’re current-state only now, and everything historical went into a .historical/ folder in each repo, change log included. And there’s a new rule that every session ends with a post like this one, drafted by a fresh copy of the agent that knows how the session went. This is the first.