brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Tailscale subnet routers hide the real client address unless you turn off SNAT

Network and access
~/tips/tip-tailscale-snat-subnet-routes

sudo tailscale set --snat-subnet-routes=false

Keep original source addresses visible in logs behind a Linux subnet router.

Behind a subnet router, every request from the tailnet looks like it comes from the router itself. That is source NAT, and Tailscale does it by default. Logs and per-client rules on the LAN side then see one address for everyone.

On a Linux subnet router you can switch it off:

sudo tailscale set --snat-subnet-routes=false

Now the devices on your LAN see the real Tailscale address of the client. That is nice for a firewall that allows one person and not another, or for logs that tell you who did what.

There is a catch, and it is the reason SNAT is the default. Your LAN devices now have to send replies for Tailscale addresses back to the subnet router. Without a route for the Tailscale address range pointing at the router’s LAN IP, the replies go to your normal gateway and vanish. Usually you add that static route on your main router, so every device picks it up.

The docs mention two more limits: the flag only works on Linux subnet routers, and combining it with an exit node on the same machine can cause dropped traffic, so they suggest separate nodes for those roles.

I would only do this when I actually need the real addresses, and if something breaks, sudo tailscale set --snat-subnet-routes=true puts it back.

Further reading: Subnet routers

Going deeper: Why a Tailscale device vanishes after 180 days, and how to stop it

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link