Archived
Check NixOS configurations / eval-hosts (pull_request) Successful in 10m42s
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 <noreply@anthropic.com>
36 lines
1.2 KiB
Nix
36 lines
1.2 KiB
Nix
{ pkgs, ... }:
|
|
|
|
{
|
|
imports = [ ./enable-service.nix ];
|
|
|
|
services.tailscale = {
|
|
# Enables the sysctl forwarding settings subnet routers need;
|
|
# without this, --advertise-routes has no effect.
|
|
useRoutingFeatures = "server";
|
|
|
|
# Lets peers reach this node directly over the tailscale UDP port
|
|
# 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
|
|
'';
|
|
};
|
|
};
|
|
}
|