From 036b5d85b8e5d0e0667851ca1ddd9f189997a257 Mon Sep 17 00:00:00 2001 From: randogoth Date: Sat, 7 Feb 2026 20:03:10 +0200 Subject: [PATCH] Tune NIC offloads for Tailscale exit node --- modules/services/tailscale.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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" ]; + }; }