Tailscale's subnet router worked perfectly until I actually needed it

Tailscale's subnet router worked perfectly until I actually needed it

A Tailscale subnet router means your home network follows you around. I set mine up so my home DNS filters would work everywhere, on every device I own, and they did. On cellular, on hotel Wi-Fi, at the coffee shop, everything on my LAN was one hop away. My NAS, every dashboard behind the Caddy setup I dumped Nginx Proxy Manager for, my DNS server. All of it. Then I connected to someone else's network, and it all fell over. When I rebuilt that network at home to work out why, my DNS server's address loaded a travel router's login page, my lab dashboards didn't exist, and the ad trackers my filters block resolved like nothing was wrong. Tailscale said it was connected. The admin console said the route was approved. Nothing was wrong, except that nothing worked. That's the one situation Tailscale's subnet routing is supposed to handle, and it's where mine broke. The network was fine. The numbers weren't. Why overlapping IP ranges break a subnet router This is a more common occurrence than you might think A subnet router works by telling every device on your tailnet, "if you want to reach 192.168.4.0/22, send it through me." That falls apart the moment your laptop or phone joins a network using the same addresses. Now the device has two answers to "where does 192.168.4.61 live?" The tunnel home, or the Wi-Fi it's sitting on. And the operating system picks one. Which one wins depends on the size of the two networks. When I recreated a stranger's network as an exact copy of mine, 192.168.4.0/22, my Windows laptop gave the tunnel's route a metric of 0, so the tie went to Tailscale. The same tie happens at home, where my laptop quietly detours LAN traffic through the subnet router. Shrink that network to a /24, and it flips. A /24 is more specific than my /22, so traffic meant for my DNS server went out over Wi-Fi to whatever sat at 192.168.4.61 on that network instead. Since my /22 is bigger than most networks I'll visit, that's the case I'll actually hit. Linux goes further when you've accepted routes: Tailscale puts subnet routes in its own routing table and checks it before the main one, so the tunnel wins and you lose access to the local network instead, including the router's own address. Either way, something you need stops working, and nothing tells you why. If you want to see it for yourself on Windows, ask PowerShell which route it would use: Find-NetRoute -RemoteIPAddress DNS-IP-HERE On macOS, it's this: route get DNS-IP-HERE My tailnet's DNS points at my Technitium cluster's virtual IP, 192.168.4.61. On an overlapping network, every DNS query goes to the wrong place, too. The filters I'd spent a whole article making work everywhere quietly switched off in exactly the spot I needed them. Everyone's router picks the same few ranges Here's the thing: I didn't pick 192.168.4.0/22. My eero did, which makes every other eero household a perfect collision. And most routers ship with one of a handful of ranges that nobody changes. Router or ISP gateway Default LAN address Netgear 192.168.1.1 or 192.168.0.1 TP-Link (routers) 192.168.0.1 or 192.168.1.1 TP-Link Deco 192.168.68.1 Asus 192.168.1.1 or 192.168.50.1, depending on model Linksys 192.168.1.1 Google Wifi 192.168.86.x GL.iNet 192.168.8.1 eero 192.168.4.1 (a /22 on mine) AT&T gateways 192.168.1.254 Xfinity gateways 10.0.0.1 If your home network is on 192.168.1.x, you'll collide with a big chunk of the networks you ever join. Google, at least, saw this coming. According to Google, if you plug a Google Wifi into a router that's already handing out 192.168.86.x addresses, it quietly moves its own network to 192.168.85.0/24, so the two don't fight. Your subnet router doesn't get that courtesy. How I fixed it without renumbering my network There's a quick fix and a longer option The textbook answer is to move your home network to a range nobody else uses. But my lab has a Technitium cluster, a pile of containers on static addresses, a NAS, and a DNS zone pointing at all of them. Renumbering is its own project, so I stuck to Tailscale fixes. The quick patch is advertising single hosts Routing always prefers the most specific match. A /32 is a route to exactly one address, so it beats a local /24 or /22 every time. Instead of advertising my whole subnet, I can advertise just the handful of hosts I need on the road: the DNS virtual IP, the Caddy box, and the NAS. tailscale set --advertise-routes=192.168.4.61/32,192.168.4.64/32,192.168.7.69/32 Approve the routes in the admin console, and those three addresses go through the tunnel on any network. The same three become unreachable locally, which almost never matters. Sure, it works, but it's a band-aid, and every new service means another route. 4via6 is the fix Tailscale built for this The proper fix is 4via6 subnet routing. The subnet router advertises your IPv4 range wrapped inside a unique IPv6 prefix, tagged with a site ID you choose. Clients route to that IPv6 address, which no coffee-shop router is going to claim, and the subnet router translates it back to plain IPv4 on the way in. First, ask Tailscale to generate the IPv6 route for your subnet. I used site ID 7: tailscale debug via 7 192.168.4.0/22 That spits out an IPv6 prefix. Advertise it alongside your normal route, because tailscale set replaces the whole list: tailscale set --advertise-routes=192.168.4.0/22,fd7a:115c:a1e0:b1a:0:7:c0a8:400/118 Approve it in the admin console, and every host behind the router gets a MagicDNS name built from its IPv4 address and the site ID. My DNS server becomes 192-168-4-61-via-7, which is ugly but works from any network. On the recreated network, pinging it got replies straight from my DNS server, at the same address that had loaded a travel router's login page minutes earlier. My Synology's DSM dashboard also came back through Caddy with a 200 OK. There are a few gotchas. If you use ACLs or grants, they need to target the IPv6 prefix, not the IPv4 range. The subnet router needs Tailscale 1.24 or later, site IDs above 255 need 1.58, and a security bulletin means you should run at least 1.102.3. And the via names only get you so far. My certificate only covers my lab domain, and HTTPS to 192-168-4-64-via-7 failed outright. Your real DNS names have to do the work. So I pointed my tailnet's DNS at the 4via6 address for my Technitium server. Tailscale grumbled that I'd only given it an IPv6 nameserver, but it worked anyway, even on the overlapping test network: blocked trackers came back blocked, and my lab names resolved again. There's a catch, though. Those names still resolve to IPv4 addresses, and some of them sit inside the range I'm colliding with. Oddly, my Windows laptop still reached Caddy at 192.168.4.64 through the tunnel, even though the local /24 should have won, and I couldn't pin down why. I wouldn't count on it. For anything that has to work everywhere, give it a /32, or point its DNS name at its via address instead. How to stop IP range collisions before they start Pick a range nobody else uses If you're starting from scratch, or brave enough to renumber, you can avoid the whole problem. The rule is simple: don't use a default. Skip 192.168.0.x, 192.168.1.x, and everything else in that table, and pick something that looks random, like 10.83.20.0/24. No router ships with that, and no hotel will land on it by accident. Keep the subnet as small as you need, too. My /22 covers four times the addresses of a /24, so it overlaps with more of other people's networks. A /24 gives you 254 usable addresses, plenty for most homes, even ones with VLANs carved out for IoT on a cheap managed switch. If you work remotely, check your employer's VPN, too. Some corporate VPNs claim all of 10.0.0.0/8, so a "random" 10.x range can collide with work instead. Docker and CGNAT can collide with you, too Docker creates its own networks from a pool of addresses, starting with 172.17.0.0/16 through 172.31.0.0/16, and then 192.168.0.0/16 in /20 chunks. The first of those chunks runs from 192.168.0.0 to 192.168.15.255, which covers my entire home network. Docker's default list puts the 172.x range first, so it's rare, but a busy host can end up with a bridge network that hijacks your LAN. Setting default-address-pools in Docker's daemon.json rules it out. Tailscale's own 100.64.0.0/10 addresses come from the block ISPs use for carrier-grade NAT, so behind CGNAT they overlap on paper. The best time to change your router's IP range is before you need remote access I never thought twice about my eero's default range until it broke the one thing Tailscale is supposed to be good at. The /32 routes got me working again in minutes, and 4via6 covers most of the rest. But a default range is a shared range, and sooner or later you'll be sitting on someone else's copy of it. If you're setting up remote access, check what range your router picked before you advertise it. It takes 30 seconds and saves a confusing afternoon.

Original Source

Read the full article at Xda-developers →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.