summaryrefslogtreecommitdiff
path: root/modules/yggdrasil-wg
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-10-10 14:21:22 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2021-10-10 14:21:22 +0200
commit50a8b8b1ac0a373690979a443d5920e98c8029b4 (patch)
tree74146352ed06df8feef06c40c00aa45056be1a30 /modules/yggdrasil-wg
parent5307f754308dcdc4d4eeecff1715409ae1c3a265 (diff)
downloadnixos-50a8b8b1ac0a373690979a443d5920e98c8029b4.tar
nixos-50a8b8b1ac0a373690979a443d5920e98c8029b4.tar.gz
nixos-50a8b8b1ac0a373690979a443d5920e98c8029b4.tar.bz2
nixos-50a8b8b1ac0a373690979a443d5920e98c8029b4.tar.xz
nixos-50a8b8b1ac0a373690979a443d5920e98c8029b4.zip
yggdrasil-wg: mtu
Diffstat (limited to 'modules/yggdrasil-wg')
-rw-r--r--modules/yggdrasil-wg/default.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/yggdrasil-wg/default.nix b/modules/yggdrasil-wg/default.nix
index 67bb34f5..8e2ba7a4 100644
--- a/modules/yggdrasil-wg/default.nix
+++ b/modules/yggdrasil-wg/default.nix
@@ -77,6 +77,7 @@ in {
77 peers = filter (value: value != null) (imap0 (ix: opts@{to, from, ...}: if from == hostName || to == hostName then linkToPeer ix opts else null) links); 77 peers = filter (value: value != null) (imap0 (ix: opts@{to, from, ...}: if from == hostName || to == hostName then linkToPeer ix opts else null) links);
78 privateKeyFile = config.sops.secrets."yggdrasil-wg.priv".path; 78 privateKeyFile = config.sops.secrets."yggdrasil-wg.priv".path;
79 postSetup = '' 79 postSetup = ''
80 ip li set mtu 1280 dev yggdrasil
80 ${concatMapStringsSep "\n" (linkArgs: let other = if linkArgs.from == hostName then linkArgs.to else linkArgs.from; in concatMapStringsSep "\n" (otherIP: "ip route replace \"${otherIP}\" dev \"yggdrasil\" table \"main\"") hostIPs.${other}) hostLinks} 81 ${concatMapStringsSep "\n" (linkArgs: let other = if linkArgs.from == hostName then linkArgs.to else linkArgs.from; in concatMapStringsSep "\n" (otherIP: "ip route replace \"${otherIP}\" dev \"yggdrasil\" table \"main\"") hostIPs.${other}) hostLinks}
81 ${concatMapStringsSep "\n" (routeArgs: let other = if routeArgs.from == hostName then routeArgs.to else routeArgs.from; in concatMapStringsSep "\n" (otherIP: concatMapStringsSep "\n" (viaIP: "ip route replace \"${otherIP}\" via \"${viaIP}\" dev \"yggdrasil\" table \"main\"") (map stripSubnet hostIPs.${routeArgs.via})) hostIPs.${other}) hostRoutes} 82 ${concatMapStringsSep "\n" (routeArgs: let other = if routeArgs.from == hostName then routeArgs.to else routeArgs.from; in concatMapStringsSep "\n" (otherIP: concatMapStringsSep "\n" (viaIP: "ip route replace \"${otherIP}\" via \"${viaIP}\" dev \"yggdrasil\" table \"main\"") (map stripSubnet hostIPs.${routeArgs.via})) hostIPs.${other}) hostRoutes}
82 ''; 83 '';