Finding which cable goes where without a MAC table
To move ports into the right VLANs I needed to know which device was on which switch port. Normally you’d look at the switch’s MAC address table. Neither the TP-Link nor the Netgear web pages show one, and the port labels I’d written myself had two uplinks swapped, so I couldn’t trust those either.
What the switches do show is per-port traffic counters (packets sent and received, good and bad). So the agent read the counters on all three switches, pushed 40 MB of random data from a host over SSH, and read them again. The host’s own port and every port along its path showed a jump of roughly 28,000 packets, and everything else stayed at its usual background level. Repeat for each host and you have a port map, including which uplink really goes where.
Two details made it reliable. The data has to be random (/dev/urandom), so nothing along the way compresses it into something too small to notice. And the load must not come from a download through the package cache on the NAS, which was my first idea: package databases aren’t cached there, so part of that traffic goes out through the firewall and lights up the firewall’s port as well, which muddles exactly the thing you’re trying to see.
The map turned out to be right at the cutover, which is more than I can say for my labels.