summaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-22 13:53:04 -0700
committerFuwn <[email protected]>2024-09-22 13:53:07 -0700
commit0fba1036e9fd13512af2456169a3366ddb55019f (patch)
treeaa73bac9035aeb278fe0cd42630e27b1713c7c7c /modules/core
parenti2p: move secrets to sops (diff)
downloadnixos-config-0fba1036e9fd13512af2456169a3366ddb55019f.tar.xz
nixos-config-0fba1036e9fd13512af2456169a3366ddb55019f.zip
tailscale: optimise subnet routers and exit nodes
Diffstat (limited to 'modules/core')
-rw-r--r--modules/core/networking/vpn/tailscale.nix31
1 files changed, 25 insertions, 6 deletions
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";
- };
-
# <https://tailscale.com/kb/1019/subnets/?tab=linux#step-1-install-the-tailscale-client>
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
+ '';
+ };
+ };
+ };
}