Skip to content

Instantly share code, notes, and snippets.

@ritiek
Last active July 30, 2023 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ritiek/e7b90d4f4f80584e5da0764b7b65323f to your computer and use it in GitHub Desktop.
Save ritiek/e7b90d4f4f80584e5da0764b7b65323f to your computer and use it in GitHub Desktop.
Tailscale

Subnet and Exit Nodes

Server:

# First time
$ echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
$ echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
$ sudo sysctl -p /etc/sysctl.d/99-tailscale.conf
$ cat /etc/hostname
awesome-machine
$ sudo tailscale up \
  --advertise-routes=192.168.1.0/24 \
  --advertise-exit-node

Client:

$ sudo tailscale up \
  --accept-routes \
  --exit-node=awesome-machine \
  --exit-node-allow-lan-access
$ ip route del 192.168.2.0/24 dev tailscale0 table 52

Make sure to enable subnet routing and exit nodes: https://login.tailscale.com/admin/machines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment