Tailscale

From David's Wiki
\( \newcommand{\P}[]{\unicode{xB6}} \newcommand{\AA}[]{\unicode{x212B}} \newcommand{\empty}[]{\emptyset} \newcommand{\O}[]{\emptyset} \newcommand{\Alpha}[]{Α} \newcommand{\Beta}[]{Β} \newcommand{\Epsilon}[]{Ε} \newcommand{\Iota}[]{Ι} \newcommand{\Kappa}[]{Κ} \newcommand{\Rho}[]{Ρ} \newcommand{\Tau}[]{Τ} \newcommand{\Zeta}[]{Ζ} \newcommand{\Mu}[]{\unicode{x039C}} \newcommand{\Chi}[]{Χ} \newcommand{\Eta}[]{\unicode{x0397}} \newcommand{\Nu}[]{\unicode{x039D}} \newcommand{\Omicron}[]{\unicode{x039F}} \DeclareMathOperator{\sgn}{sgn} \def\oiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x222F}\,}{\unicode{x222F}}{\unicode{x222F}}{\unicode{x222F}}}\,}\nolimits} \def\oiiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x2230}\,}{\unicode{x2230}}{\unicode{x2230}}{\unicode{x2230}}}\,}\nolimits} \)

Tailscale is an local mesh VPN which sets up direction connections between devices in your Tailscale network. Under the hood, it uses its own userspace wireguard implementation along with NAT traversal. In the event devices cannot connect directly, traffic passes through it's DERP relay servers.

Exit Node

For processing the exit node, Tailscale uses iptables with mask 0xFF0000.
This may conflict with other applications such as Calico. This issue suggests changing the mask used in Calico.

CLI

Tailscale comes with the command tailscale. Some common use cases are:

# See other hosts and their tailscale ips
tailscale status

# Check if another host is directly reachable
tailscale ping $HOST

Split DNS

Tailscale allows you to overwrite the DNS on each client and supports split DNS.
You can combine this with a custom dns resolver (e.g. nextdns) to rewrite certain DNS entries when Tailscale is connected.
One idea could be to let Cloudflare proxy all your websites to get CDN, DDOS protection, etc. But clients with Tailscale can directly connect with your webserver.

  • Note that one issue with this is that applications and OSs tend to cache DNS results so switching Tailscale on and off can be an issue.
  • If you only need access when Tailscale is connected, you can just stick the Tailscale IP as a public DNS entry.