From 113bbe17ab28c5617167b38a6f02b1273cede963 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Thu, 9 May 2024 20:13:46 +0200 Subject: [PATCH] Linux optimizations for subnet routers and exit nodes --- tailscale/Dockerfile | 1 + tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/tailscale/Dockerfile b/tailscale/Dockerfile index e82181dc..7a9aee07 100755 --- a/tailscale/Dockerfile +++ b/tailscale/Dockerfile @@ -10,6 +10,7 @@ ARG BUILD_ARCH=amd64 ARG TAILSCALE_VERSION="v1.66.0" RUN \ apk add --no-cache \ + ethtool=6.6-r0 \ ipcalc=1.0.3-r0 \ iproute2=6.6.0-r0 \ iptables=1.8.10-r3 \ diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run index acd3fb52..4e463fc8 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run @@ -12,6 +12,12 @@ declare login_server declare tags declare keyexpiry +# Linux optimizations for subnet routers and exit nodes +# Based on: https://tailscale.com/kb/1320/performance-best-practices#linux-optimizations-for-subnet-routers-and-exit-nodes +# Note: Changes made via ethtool are not persistent and will be lost after the machine shuts down. +# Note: Executing it before "tailscale up" to avoid warning messages +ethtool -K $(ip route show 0/0 | cut -f5 -d' ') rx-udp-gro-forwarding on rx-gro-list off + # Default options options+=(--hostname "$(bashio::info.hostname)")