Tailscale: Difference between revisions
No edit summary |
|||
| (6 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
== Basic setup == | |||
To enable Tailscale, add the following to your configuration: | |||
{{File|3={ | |||
services.tailscale = { | |||
enable = true; | |||
# Enable tailscale at startup | |||
# If you would like to use a preauthorized key | |||
#authKeyFile = "/run/secrets/tailscale_key"; | |||
== | }; | ||
}|name=/etc/nixos/configuration.nix|lang=nix}} | |||
# | After enabling, you can login to your Tailscale account with:<syntaxhighlight lang="console"> | ||
# tailscale login | |||
</syntaxhighlight>If you are using features like subnet routers or exit nodes you will also need to set <code><nowiki>services.tailscale.useRoutingFeatures</nowiki></code> to "server", "client" or "both" depending on the role of your machine. | |||
For more configuration option, refer to <code>[https://search.nixos.org/options?show=services.tailscale services.tailscale]</code> . | |||
== Split DNS | == Split DNS == | ||
Tailscale | Tailscale supports "Split DNS" where you can access local services (not exposed to the internet) on a different network (e.g. your friend's house) as if you are in that local network. | ||
See KTZ Systems Split DNS overview: https://www.youtube.com/watch?v=Uzcs97XcxiE | See KTZ Systems Split DNS overview: https://www.youtube.com/watch?v=Uzcs97XcxiE | ||
| Line 25: | Line 29: | ||
== Configuring TLS == | == Configuring TLS == | ||
{{Expansion| | |||
* Set up Systemd service to run this command at regular intervals to avoid cert expiration. | |||
* Show how to run for multiple services on a single machine. | |||
}} | |||
Per [https://tailscale.com/kb/1153/enabling-https/?q=tls#provision-tls-certificates-for-your-devices Enabling HTTPS in the Tailscale documentation], run the following: | Per [https://tailscale.com/kb/1153/enabling-https/?q=tls#provision-tls-certificates-for-your-devices Enabling HTTPS in the Tailscale documentation], run the following: | ||
| Line 41: | Line 50: | ||
services.tailscale.permitCertUid = "caddy"; | services.tailscale.permitCertUid = "caddy"; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Known issues == | == Known issues == | ||
| Line 55: | Line 58: | ||
=== DNS === | === DNS === | ||
There is also a known issue with DNS when using the default NixOS configuration; see [https://github.com/tailscale/tailscale/issues/4254 GitHub issue 4254]. Enabling [[systemd-resolved]] seems to be some part of the solution to this problem, as well as ensuring that DHCP is not enabled on the "tailscale0" network interface. Please see the GitHub issue for more information. | There is also a known issue with DNS when using the default NixOS configuration; see [https://github.com/tailscale/tailscale/issues/4254 GitHub issue 4254]. Enabling [[systemd-resolved]] seems to be some part of the solution to this problem, as well as ensuring that DHCP is not enabled on the "tailscale0" network interface. Please see the GitHub issue for more information. | ||
=== No internet when using exit node === | |||
When you turn on exit nodes, NixOS's reverse path filter immediately starts dropping all incoming traffic related to wireguard tunnels, tailscale's control plane connection, etc. etc. | |||
The quick fix for NixOS users is to set the following option in your NixOS config: | |||
<code>networking.firewall.checkReversePath = "loose";</code> | |||
[https://github.com/tailscale/tailscale/issues/4432#issuecomment-1112819111 Issue in Tailscale tracker] | |||
== Running multiple Tailnet-accessible services on a single machine == | == Running multiple Tailnet-accessible services on a single machine == | ||