Tailscale: Difference between revisions
Optimize |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 25: | Line 25: | ||
== 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 31: | Line 36: | ||
}} | }} | ||
As an alternative, you can set up [https://wiki.nixos.org/wiki/Caddy Caddy] to create and manage SSL certs automatically as [https://tailscale.com/kb/1190/caddy-certificates Caddy recognizes Tailscale urls]. After replacing <code><MACHINE_NAME></code>, <code><TAILNET_NAME></code>, <code><port></code> with your tailscale machine name, tailscale tailnet name, and the port of the local service you want to forward, you can add the following to your <code>configuration.nix</code>:<syntaxhighlight lang="nixos"> | |||
services.caddy = { | |||
enable = true; | |||
virtualHosts."<MACHINE_NAME>.<TAILNET_NAME>".extraConfig = '' | |||
reverse_proxy 127.0.0.1:<port> | |||
''; | |||
}; | |||
# Allow the Caddy user(and service) to edit certs | |||
services.tailscale.permitCertUid = "caddy"; | |||
</syntaxhighlight> | |||
== Known issues == | == Known issues == | ||
=== IPv6 === | |||
If you encounter issues with IPv6 not working through your NixOS-based exit node, this might be an issue with the Tailscale client's detection of whether IPv6 NAT is supported. This is the "checkSupportsV6NAT" function in the Tailscale codebase. Enabling <code><nowiki>networking.nftables.enable = true;</nowiki></code> and then rebooting may fix this issue if you are using iptables. | |||
=== 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. | ||