04 December 2026

📌

Friday night in Gourock, Black Sabbath's 13 in the headphones, a new switch on the desk and a plan that started as "let's put pfSense in front of everything" and, for now, stopped one box earlier.

The firewall comes in January. The switch came today. And since the rule I gave myself for this round was simple - if it's my house, I want everything open source - the switch had to be one that runs OpenWrt. This is the log of the evening: what I bought, how the flashing went, what scared me, and what I got wrong.

the switch

A Zyxel GS1900-24E. Twenty-four gigabit ports, fanless, a Realtek RTL8382M inside. I looked at 2.5G for a while and then let it go: it's a house, not a datacenter.

The catch with this model is the hardware revision. There are at least two, A1 and B1, they are not interchangeable, and the box doesn't tell you which one you are buying. I asked the seller. The answer was polite and useless - the latest iteration, minor changes to the hardware configuration, a new registration and a new EAN. So I ordered it, turned it upside down when it arrived, and read the label. B1.

That matters because of where OpenWrt is today. The current stable release only ships images for the A1. The B1 has its own images, but only in the snapshot builds. So snapshot it is, with the two things that come with it: no web interface out of the box, and a package repository that moves every day.

One more thing worth knowing before you start. Older OpenWrt releases on these switches kept the vendor firmware on a second partition, so you could always boot back into it. That is gone: the two partitions are merged now, the OEM firmware gets overwritten, and the only way back is a serial console. I ordered a USB serial adapter. It arrives tomorrow. I flashed anyway.

a cable, an address, and NetworkManager

Out of the box the switch sits on 192.168.1.1, and my LAN is not on that network. I plugged a USB Ethernet adapter into the desktop, connected it to the switch, and gave it an address by hand.

doas ip link set <usb-adapter> up
doas ip addr add 192.168.1.10/24 dev <usb-adapter>

Ping: nothing. The address was gone. NetworkManager had seen an interface with no profile, decided it was "disconnected", and cleaned up after me. One line fixed it.

nmcli device set <usb-adapter> managed no

Then the address stayed, the ping answered, and the vendor web UI came up. Device Information confirmed the label: Revision B1.

the flash

The method is the documented one, in two stages. First you upload an initramfs image through the vendor's own firmware page, which boots OpenWrt in RAM without touching the flash. Then, from that temporary OpenWrt, you write the real image.

Both files come from the snapshot directory for the realtek/rtl838x target, and both get checked before going anywhere near the switch.

sha256sum -c sha256sums --ignore-missing
openwrt-realtek-rtl838x-zyxel_gs1900-24e-b1-initramfs-kernel.bin: OK
openwrt-realtek-rtl838x-zyxel_gs1900-24e-b1-squashfs-sysupgrade.bin: OK

I renamed the initramfs to something short - initramfs.bin - uploaded it over HTTP to the active image slot, and rebooted. When it came back, the same address answered with a different voice.

ssh root@192.168.1.1 'ubus call system board'
...
"model": "Zyxel GS1900-24E B1",
"board_name": "zyxel,gs1900-24e-b1",
"rootfs_type": "initramfs",
...

Running from RAM. From there: copy the sysupgrade image across, test it, write it.

scp -O openwrt-...-b1-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/sysupgrade.bin
ssh root@192.168.1.1 'sysupgrade -T /tmp/sysupgrade.bin && sysupgrade -n /tmp/sysupgrade.bin'

And then the line nobody wants to read while a device with no way back is writing its own flash.

Command failed: ubus call system sysupgrade ... (Connection failed)

It is not a failure. The upgrade kills the services it was started from, the SSH session dies mid-sentence, and the error is the session's last word. The right thing to do is nothing. I did nothing for sleep 400, asked again, and got "rootfs_type": "squashfs". Installed.

making it part of the network

A fresh snapshot is a switch with one address, no DHCP server, no web page and a root account. I set a password, then moved it onto my network - with a backup of the file first, and keeping the old address alive next to the new one until everything else was proven.

cp /etc/config/network /etc/config/network.bak-20261204
uci add_list network.lan.ipaddr="192.168.0.2/24"
uci set network.lan.gateway="192.168.0.1"
uci add_list network.lan.dns="<pi-hole>"
uci commit network
/etc/init.d/network reload

Two addresses on the same interface, one for the LAN and one as a lifeline. The lifeline came off at the end of the night, with uci del_list, once the switch had survived a power cycle and the move to its final place.

the part I was afraid of

Moving every wired machine in the house from an unmanaged switch to a new one means unplugging every wired machine in the house. My fear was specific: that the router would take the opportunity to hand everybody a new address, and that half of my services - which find each other by IP - would spend the evening looking for one another.

So before touching a cable I went through the router's DHCP page and reserved an address for every machine that didn't have one set locally. The router is a Virgin Hub 3.0, and I'll admit it: as a router it is really awful. But it can reserve addresses, and that was all I needed from it tonight.

Then one cable at a time. The new switch first hung off the old one, so that both worlds stayed connected, and after every single move the same loop.

for h in <the hosts that matter>; do
  ping -c 1 -W 1 192.168.0.$h >/dev/null && echo "192.168.0.$h ok" || echo "192.168.0.$h NO"
done

Desktop. AI box. Tor relay. NAS. The two Raspberry Pis. Proxmox. Every time, a column of ok. When everything was on the Zyxel, its uplink moved from the old switch to the router, the old switch was powered off, and the loop said ok one more time. Nobody changed address. The fear was reasonable and wrong.

nine cables, eight lights

Then I counted. Nine cables in, eight LEDs blinking.

The switch can answer this kind of question itself.

for p in /sys/class/net/lan*; do
  echo "$(basename $p) link=$(cat $p/carrier 2>/dev/null)"
done | grep "link=1"

Eight ports with link. The ninth cable went to the second network port of the Proxmox host, a port I had never configured: the interface was down on the host, so there was nobody on the other end to talk to. Not a fault. A cable waiting for a job.

the hub that stops answering

One thing looked wrong for a few minutes. A ping to the outside lost a packet. Then a hundred fast pings to the router lost seventy-three, which is the kind of number that makes you look at the new switch with suspicion.

The shape of the loss said otherwise. The first twenty-six came back, one after the other, and then silence until the end. That is not a bad cable - a bad cable loses packets here and there. That is something deciding it has answered enough.

Same test, same path through the switch, but to the NAS instead of the router.

100 packets transmitted, 100 received, 0% packet loss
rtt min/avg/max/mdev = 0.076/0.283/0.387/0.053 ms

The switch is clean. My reading is that the hub rate-limits pings, but I haven't proven that - I have only proven that the Zyxel is innocent. The rest will be clearer in January, when the hub gets demoted to a modem.

a web page, after all

SSH is enough to run a switch. A page that shows twenty-four ports with their link state and traffic is nicer, and it is one package away.

apk add luci-ssl

Twenty-eight packages, less than a megabyte of flash. And a web server listening on port 80 only - no 443. The order of installation explains it: the web server was installed and started a few steps before the tool that generates the certificate. A restart of uhttpd produced a key, a self-signed certificate and the HTTPS port.

Port 80 was still serving the login page in clear, though, and a root password in clear on the LAN is exactly what I don't want. One option closes it.

cp /etc/config/uhttpd /etc/config/uhttpd.bak-20261204
uci set uhttpd.main.redirect_https="1"
uci commit uhttpd
/etc/init.d/uhttpd restart

Then the switch got a name behind my reverse proxy, like everything else in the house: a proxy host with an HTTPS backend, so the traffic is encrypted all the way to the switch and the browser sees my own certificate instead of a warning. The direct address still works, for the day the proxy is down.

keys, and the mistake of the night

Last piece: SSH with a key instead of a password. Dropbear reads its keys from /etc/dropbear/authorized_keys, a Host block went into my SSH config (after a copy of the file), and once the key was proven to work I turned password logins off.

uci set dropbear.main.PasswordAuth="off"
uci set dropbear.main.RootPasswordAuth="off"
uci commit dropbear
/etc/init.d/dropbear restart

Over SSH. The restart stopped the SSH server, the SSH server took my session with it, and my session was the thing that was supposed to start it again.

ssh: connect to host 192.168.0.2 port 22: Connection refused

The switch kept switching - forwarding doesn't care about any of this - and the web interface I had installed a little earlier was still there, with a page that lists the services and lets you start them. One click and SSH was back, keys only. If I had done these two steps in the opposite order, I would have been waiting for a serial adapter to get into my own switch.

what's left

The configuration is saved off the switch, three times over the evening, each time something changed.

(umask 077; ssh switch 'sysupgrade -b -' > zyxel-config-20261204.tar.gz)

The archive holds the configuration, not the packages: after a reinstall the web interface has to be added again. It also holds a password hash and the switch's keys, which is why it is born readable by me only and why it is not attached to this note.

Tomorrow the serial adapter, to make sure the way back actually exists before I need it. Later, cable only for the two machines that are still on both cable and Wi-Fi. In January the firewall, an access point, and the hub in modem mode.

For tonight: twenty-four ports, eight links, one unused cable, no proprietary firmware between my machines.


13 did its part tonight. Hearing Ozzy's voice again after a long time gave me the push for a job I would never have started otherwise - too complex, and postponed for many months, maybe years.

Thanks, Ozzy.