The Plan Meets Reality
A few weeks ago, I wrote The Pocket Router I’d Hand a Family Member. It described a travel router, my private mesh, an exit node at home, and a family member who plugs it in.
Then reality wrote its own version. I was at a relative’s house across the country. At two in the morning, my entire homelab went offline. The router at home had quietly stopped passing traffic. My home exit node was gone, and so was the device that normally signs new members into my network. And I had a small GL.iNet Beryl AX in its box.
This is the honest build log. It covers what I set up, the order I did it in, and the four bugs I found only because I broke things on purpose.
The goal was simple to say and harder to do. Leave the router there, manage it from home, and make sure it never takes the house offline.
Step 1: First Contact (and a Case-Sensitive Lesson)
A new GL.iNet router broadcasts its own Wi-Fi with a key printed on the label. My first attempt to join failed with WRONG_KEY, twice.
The key on the sticker was uppercase, and I had typed it in lowercase. Router keys are case-sensitive. On a tiny label, it is easy to read QX7P… as qx7p…. If a join fails on a brand-new device, check the case before you check anything else.
Once connected, I set the Wi-Fi name and admin password on the router’s own setup page. I did everything else through its API. That made every change a command I could repeat and document. I put the admin password into a file only my user can read. It never went into a command line or a log.
Step 2: Joining My Private Network, Even With Home Down
My mesh uses Tailscale with Tailnet Lock turned on. A new device can talk to nothing until a trusted signing device signs its key. One of my two signers lives at home, and home was offline. For a moment, I thought I was stuck.
I was not. My laptop is the other signer. This is the process:
- Turn on Tailscale in the router (its firmware has it built in). Let it advertise its own small LAN, so I can reach things behind it later.
- Open the login link it prints and sign in with my account.
- The router joins, but shows up as locked out.
- From the laptop:
tailscale lock sign nodekey:<router-key> tlpub:<router-lock-key>.
Seconds later, the router reported “accessible under Tailnet Lock”. A cloud node on the other side of the country could load its admin page. Then I changed three settings in the admin console:
- Approve the subnet route, so I can reach devices behind it.
- Disable key expiry. Otherwise, in six months the router needs a new login and a new signature, from across the country.
- Rename it to something I’ll recognise.
I learned two lessons. Know where your signing keys live before you need them. And turn off key expiry on an unattended device, or it will lock itself out on a schedule.
Step 3: Choosing an Exit Node by Measurement
With home down, the exit node had to be one of my three cloud nodes. I did not guess. I measured round-trip time from the router itself, with five samples each:
| Exit | Latency |
|---|---|
| Farore | 60 ms, every sample |
| Dinraal | 90 ms |
| Naydra | 95–96 ms |
Farore won clearly. Now the router’s own traffic and every device behind it reach the internet from Farore’s address. That gives about 66 Mbit/s down through a small one-CPU VPS.
Step 4: A Watchdog, Because Exit Nodes Fail
The original plan skipped over one part: if the exit node dies, everything behind the router loses the internet. Tailscale does not fall back on its own. For a router I will not be near, that is unacceptable.
So the router runs a small watchdog:
- Every 5 seconds, it checks real internet through the current path. It pings well-known addresses, with no DNS involved.
- After 2 failed checks, it switches to the next healthy cloud exit.
- If no exit works, it switches to direct internet on the local connection.
- When the preferred exit is healthy for 2 minutes, it switches back.
- The exit I pick in the router’s UI is the “preferred” one. If I clear it there, the watchdog turns off.
Testing it by breaking it
I tested it the only honest way. On Farore, I briefly blocked forwarding for the router’s traffic only. A timer removed the block after 30–90 seconds. That found two bugs:
Bug 1: 40–80 seconds to react, instead of ~10. The first version ran from cron as one-minute slices. When a slice ran long, the next one saw the lock and quietly exited. That left a gap where nothing watched. The fix was a proper always-running service with automatic restart. A cron job now restarts it only if it ever disappears.
Bug 2: the restart check could never fire. It looked for the watchdog in the process list with pgrep -f. But the command that did the search contained the same text, so it always found itself. (This one also bit me while I cleared old processes: I killed my own SSH session.) The fix is the classic bracket trick, pgrep -f "[e]xitwd". It cannot match its own command line.
After both fixes, the router went from outage to back online through Dinraal in 21 seconds. Then it went back to Farore by itself.
Step 5: Alerts That Work When Home Doesn’t
If you never hear from a watchdog, you will forget it. So the router sends Gotify notifications:
- failed over to another exit (normal priority),
- using direct internet because all exits failed (urgent),
- back on the preferred exit (low priority).
Two design choices mattered. First, the router talks to my Gotify server directly over the mesh. Alerts arrive even when my home lab is down. Second, the router generated its notification key on the router itself. The private half never left it. I registered only the public half with Gotify.
The final test gave exactly what I wanted. My phone showed “failed over to Dinraal” 24 seconds after the block. It showed “back on Farore” two minutes after the block lifted.
Step 6: Updating Something You Can’t Touch
The Tailscale dashboard flagged the router as out of date, and the one-click update failed. GL.iNet bundles Tailscale into its firmware, so Tailscale’s own updater cannot replace it.
Tailscale is my only way into this remote device, so an update deserves care. The upgrade script does this:
- It downloads the official build and checks it against the published checksum.
- It keeps the factory version (that lives in the router’s read-only area anyway).
- It runs the swap on the router itself, detached, so a dropped SSH session cannot leave it half-done.
- It rolls back automatically if Tailscale is not running and signed within 60 seconds.
Tailscale was healthy in 4 seconds. The signature, exit node, route and watchdog all survived. I hit two router-specific surprises on the way. The router’s minimal shell has no nohup, so I used ( trap "" HUP; exec … ) & instead. And the official Tailscale build is not the single combined binary that GL ships, so I had to install both the daemon and the CLI.
Step 7: Ads Blocked, Streaming Allowed
The family had two last requests: block all ads, and make the streaming service work.
Ad-blocking runs on the router itself, in its built-in AdGuard Home. It uses a strong blocklist of about 212,000 ad, tracker and malware domains. Because it runs locally, it keeps working when my home lab does not.
The streaming service was the interesting one. DNS did not block it at all. The service answered 406 Not Acceptable because the traffic came from a cloud provider’s IP. Streaming services refuse VPN and datacenter addresses on purpose.
The fix sends only that service straight out the local connection. Everything else keeps using the exit:
- When anything looks up the service’s domains, the router adds the resulting IPs to a short-lived list. This is an
ipset, and entries expire after a day. - The firewall marks traffic to those IPs with Tailscale’s own “don’t tunnel this” mark.
- Tailscale’s routing rules already send that mark to the normal table, and out the local connection.
ipset -exist create bypass4 hash:ip timeout 86400
iptables -t mangle -I PREROUTING -m set --match-set bypass4 dst -j MARK --set-xmark 0x80000/0xff0000
iptables -t mangle -I OUTPUT -m set --match-set bypass4 dst -j MARK --set-xmark 0x80000/0xff0000
The tests found two more gotchas:
- The ad-blocker changed the DNS path. The firmware sends all DNS straight to AdGuard. That skips the DNS server I had taught to fill the list.
- AdGuard Home can fill an ipset itself, so I gave it the same domain list. Now the bypass works whichever way DNS flows.
- My firewall hook did not survive a reload. On this firmware, the classic
/etc/firewall.userruns on a full firewall restart but not on a reload. - I registered the script as its own firewall include, with reload enabled. That fixed it, and I proved it with a reload on purpose.
Now the streaming service loads, ads stay blocked, and everything else still leaves through the cloud exit.
How I Manage It From Home
From my desk, the router is one more machine on my private network:
sshwith my key (added on purpose, and kept across firmware updates),- its admin page over the mesh,
- the watchdog’s status and log one command away,
- alerts on my phone the moment anything fails over.
And if everything goes wrong, it falls back to the local internet by itself. The people in the house never notice.
What Changed From the Plan
- The exit node isn’t at home. Home was down, so the router uses the cloud node with the lowest latency. It can switch to home later.
- The plan did not cover failover. In practice, failover was the most important piece.
- Signing worked remotely because the laptop is a signer. Without it, nothing new could join until I got home.
- Streaming needed an exception. “Everything through the exit” sounds clean until a service refuses datacenter IPs.
Takeaways
- If a new device will not take its printed key, check the case before anything else.
- Know where your Tailnet Lock signing keys live. A second signer on your laptop saves the day.
- Turn off key expiry on unattended devices, and approve their routes on purpose.
- Choose exit nodes by measurement from the device itself.
- An exit node without failover is a single point of failure for the whole house.
- Build the watchdog, then break things on purpose to test it.
- Watch for a
pgrepthat matches itself, and for cron slices that leave unwatched gaps. - Send alerts from a remote device over the mesh, so they arrive when home is down.
- Upgrade remote devices with a checksum, a detached swap and an automatic rollback.
- Streaming services block datacenter IPs. Bypass only those domains with an ipset and Tailscale’s own bypass mark.
- Make sure the hook survives firewall reloads and changes to the DNS path.