Tailscale: Difference between revisions

m Mention headscale
Jad (talk | contribs)
I described how Tailscale's recommendations on optimizing UDP throughput translate into NixOS.
Line 59: Line 59:
* Set up Systemd services for the additional host names
* Set up Systemd services for the additional host names
}}
}}
== Optimize the performance of subnet routers and exit nodes ==
Tailscale gives [https://tailscale.com/kb/1320/performance-best-practices#enable-on-each-boot recommendations] on how to optimize UDP throughput of your node.
You need to have <code>ethtool</code> and <code>networkd-dispatcher</code> installed, and to create the appropriate rule for Tailscale.
Supposing the network device you'll be using is called <code>eth0</code>, you can add the following to your <code>configuration.nix</code>:<syntaxhighlight lang="nixos">
environment.systemPackages = with pkgs; [
...
ethtool
networkd-dispatcher
];
...
services = {
networkd-dispatcher = f
  enable = true;
  rules."50-tailscale" = {
  onState = ["routable"];
  script = ''
    #!${pkgs.runtimeShel1}
    ethtool -K eth0 rx-udp-gro-forwarding on rx-gro-list off
    exit 0
  '';
  };
};
};
</syntaxhighlight>