Reach your own LAN again when Tailscale advertises it as a subnet route
Confirmed /usr/share/omarchy/bin/omarchy-install-service-tailscale on 4.0.4-1 (identical to quattro) runs sudo tailscale up --accept-routes and then sudo tailscale set --operator="$USER". router_linux.go confirms table 52 and rules at 10/30/50/70 added to ipPolicyPrefBase 5200, so 5210 to 5270, and Tailscale's 'LAN traffic prioritization with overlapping subnet routes' page names the same priorities and recommends exactly this kind of rule (ip rule add to <lan> priority 2500 lookup main). tailscale/tailscale#1227 is open since 2021-01-29. The symptom overstates the outbound case. Tailscale's 'Can't connect to LAN' page says the routing prefers the subnet router and the client drops packets whose source is the device's LAN address, and that outbound fails only when a Linux subnet router has SNAT disabled. Routes in table 52 use the tailscale0 address as source, so with the default SNAT outbound connections still succeed, relayed through the subnet router. Inbound connections from the LAN are the ones that reliably hang. Symptom and cause corrected to that. The fix and the NetworkManager routing-rules syntax hold. Not exercised: no tailnet with a subnet router was available.
The routing rule trusts whatever network the home profile is connected to. If an untrusted network ever uses the same SSID and prefix, traffic to that prefix stays local instead of going through the tunnel.
Symptom
At home, with Tailscale up, SSH or any other connection from another machine on the LAN into the laptop hangs, even though both sit on the same Wi-Fi. Connections from the laptop to the printer, NAS or router admin page by their 192.168.x.x addresses are slow or flaky, or fail outright if the subnet router is offline or has SNAT disabled. Everything works again the moment you run tailscale down. It only happens on a network that some node on your tailnet (a Raspberry Pi, a NAS, the router) advertises as a subnet route.
Cause
Omarchy's omarchy-install-service-tailscale runs sudo tailscale up --accept-routes. With accepted routes, tailscaled on Linux puts every advertised subnet into its own routing table 52 and adds policy rules that consult table 52 before the main table (priorities 5210 to 5270 by default, from wgengine/router/osrouter/router_linux.go). If the subnet advertised is the one you are physically on, traffic to your neighbours goes into the tunnel to the subnet router instead of straight out of Wi-Fi. Outbound connections still work while the subnet router is up and has SNAT on, which is the default, because the router relays them, only slower. Replies to connections that arrive from the LAN take the same tunnel path with your LAN address as the source, and the Tailscale client drops packets with an unexpected source address, so inbound connections hang. With SNAT disabled on a Linux subnet router, outbound connections fail too. Tailscale does not skip a route because a directly attached interface already covers it. That request is upstream issue tailscale/tailscale#1227, open since 2021.
Fix
Confirm the diagnosis:
ip route get 192.168.1.20 # replace with a LAN host. 'dev tailscale0' is the problem
ip route show table 52 | grep 192.168
ip rule | grep -E '52[0-9]{2}'
Simplest fix, if you do not need any advertised subnet from this machine:
tailscale set --accept-routes=false
sudo is not needed once the installer's tailscale set --operator="$USER" has applied.
To keep accepting other subnets but use the local path for the network you are on, add a policy rule to the home Wi-Fi or Ethernet profile that sends that one subnet to the main table before Tailscale's rules are consulted. NetworkManager installs it only while that profile is active, so it does nothing on other networks:
nmcli connection modify "<home profile>" +ipv4.routing-rules "priority 5000 to 192.168.1.0/24 table 254"
nmcli connection up "<home profile>"
Use your real LAN prefix (ip -4 addr show gives it). Table 254 is main. Priority 5000 sorts before Tailscale's 52xx rules.
Verify
ip rule | grep 'lookup main' | grep 192.168
ip route get 192.168.1.20 # dev wlo1 or your Ethernet, not tailscale0
tailscale status
The printer or NAS should answer, and other subnets advertised on the tailnet still route through tailscale0.
Sources
- https://github.com/omacom/omarchy/blob/quattro/bin/omarchy-install-service-tailscale
- https://github.com/tailscale/tailscale/issues/1227
- https://github.com/tailscale/tailscale/blob/main/wgengine/router/osrouter/router_linux.go
- https://tailscale.com/docs/reference/troubleshooting/connectivity/connect-lan-failure
- https://tailscale.com/docs/features/subnet-routers
- https://tailscale.com/docs/reference/troubleshooting/network-configuration/lan-traffic-overlapping-subnets