contents…
-
On the relay node, run:
$ sudo tailscale up -advertise-routes=192.168.16.0/24
-
Go to the Tailscale admin console and authorize subnet routes for the relay node.
-
Back on the relay node, enable IP forwarding:
$ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
-
Enable IP masquerading for the _LAN-facing_ interfaces:
$ sudo nft add rule ip nat POSTROUTING oifname "enp2s0" counter masquerade
Alternatively, for iptables:
$ sudo iptables -t nat -A POSTROUTING -j MASQUERADE -o enp2s0
-
Confirm it works by pinging a machine on your LAN from a machine that's not, for example pinging
192.168.16.1
from a phone with the Tailscale VPN on mobile data.