diff --git a/modules/services/tailscale.nix b/modules/services/tailscale.nix index 4269f74..5664ae4 100644 --- a/modules/services/tailscale.nix +++ b/modules/services/tailscale.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { services.tailscale.enable = true; services.tailscale.port = 41641; @@ -8,4 +8,19 @@ "--advertise-exit-node" "--hostname=bucur" ]; + + environment.systemPackages = [ pkgs.ethtool ]; + + systemd.services.tailscale-offload-tune = { + description = "Disable GRO forwarding for Tailscale exit node performance"; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = '' + /bin/sh -c '${pkgs.iproute2}/bin/ip -o route get 8.8.8.8 | ${pkgs.coreutils}/bin/cut -f 5 -d " " | xargs -r ${pkgs.ethtool}/bin/ethtool -K rx-udp-gro-forwarding on rx-gro-list off' + ''; + }; + wantedBy = [ "multi-user.target" ]; + }; }