From 0fba1036e9fd13512af2456169a3366ddb55019f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 22 Sep 2024 13:53:04 -0700 Subject: tailscale: optimise subnet routers and exit nodes --- modules/core/networking/vpn/tailscale.nix | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'modules/core/networking/vpn') diff --git a/modules/core/networking/vpn/tailscale.nix b/modules/core/networking/vpn/tailscale.nix index 21f471a..06c5b50 100644 --- a/modules/core/networking/vpn/tailscale.nix +++ b/modules/core/networking/vpn/tailscale.nix @@ -1,15 +1,34 @@ -{ config, ... }: +{ + config, + lib, + pkgs, + ... +}: { networking.firewall.trustedInterfaces = [ "${config.services.tailscale.interfaceName}" ]; - services.tailscale = { - enable = true; - useRoutingFeatures = "both"; - }; - # boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; "net.ipv6.conf.all.forwarding" = true; }; + + services = { + tailscale = { + enable = true; + useRoutingFeatures = "both"; + }; + + networkd-dispatcher = { + enable = true; + + rules."50-tailscale" = { + onState = [ "routable" ]; + + script = '' + ${lib.getExe pkgs.ethtool} -K enp42s0 rx-udp-gro-forwarding on rx-gro-list off + ''; + }; + }; + }; } -- cgit v1.2.3