From 4be064572da748793a8c9fec2de24a2a2c9b386e Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Sun, 26 Jul 2026 09:13:28 +1000 Subject: [PATCH] feat(tailscale): enable UDP GRO forwarding on subnet router uplink Adds a oneshot systemd service that sets ethtool rx-udp-gro-forwarding on and rx-gro-list off on the default-route interface at boot, silencing Tailscale's warning about suboptimal UDP GRO forwarding on subnet routers. Interface is discovered dynamically via `ip route get` so it works on all platforms regardless of NIC naming. Co-Authored-By: Claude Sonnet 4.6 --- modules/tailscale/subnet-router.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/tailscale/subnet-router.nix b/modules/tailscale/subnet-router.nix index 286c896..49497a0 100644 --- a/modules/tailscale/subnet-router.nix +++ b/modules/tailscale/subnet-router.nix @@ -1,4 +1,4 @@ -_: +{ pkgs, ... }: { imports = [ ./enable-service.nix ]; @@ -12,4 +12,24 @@ _: # instead of relaying through DERP. openFirewall = true; }; + + # Tailscale recommends these ethtool flags on the uplink interface to get + # full UDP GRO throughput on subnet routers (https://tailscale.com/s/ethtool-config-udp-gro). + # The interface is derived from the default route so it works regardless of + # what the NIC is named on a given host. + systemd.services.tailscale-udp-gro = { + description = "Enable UDP GRO forwarding on uplink for Tailscale subnet router"; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.ethtool pkgs.iproute2 ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + ExecStart = pkgs.writeShellScript "tailscale-udp-gro" '' + NETDEV=$(ip -o route get 8.8.8.8 | cut -f 5 -d " ") + ethtool -K "$NETDEV" rx-udp-gro-forwarding on rx-gro-list off + ''; + }; + }; } -- 2.54.0