Tune NIC offloads for Tailscale exit node

This commit is contained in:
randogoth 2026-02-07 20:03:10 +02:00
parent 8ca0aa2901
commit 036b5d85b8

View file

@ -1,4 +1,4 @@
{ ... }: { pkgs, ... }:
{ {
services.tailscale.enable = true; services.tailscale.enable = true;
services.tailscale.port = 41641; services.tailscale.port = 41641;
@ -8,4 +8,19 @@
"--advertise-exit-node" "--advertise-exit-node"
"--hostname=bucur" "--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" ];
};
} }