diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-10-17 21:16:40 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-10-17 21:16:40 +0200 |
commit | a4b309e27214daf98c70676324418e23578ede22 (patch) | |
tree | dbe68d042ab10eb7d0b0576b1e4db2cc74323e23 | |
parent | 610bf85460c1371aa2af035054b7f9d641132388 (diff) | |
download | nixos-a4b309e27214daf98c70676324418e23578ede22.tar nixos-a4b309e27214daf98c70676324418e23578ede22.tar.gz nixos-a4b309e27214daf98c70676324418e23578ede22.tar.bz2 nixos-a4b309e27214daf98c70676324418e23578ede22.tar.xz nixos-a4b309e27214daf98c70676324418e23578ede22.zip |
yggdrasil-wg: ...
-rw-r--r-- | hosts/vidhar/default.nix | 3 | ||||
-rw-r--r-- | modules/yggdrasil-wg/default.nix | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix index 3c6aeb16..107906c7 100644 --- a/hosts/vidhar/default.nix +++ b/hosts/vidhar/default.nix | |||
@@ -85,6 +85,9 @@ | |||
85 | allowedTCPPorts = [ | 85 | allowedTCPPorts = [ |
86 | 22 # ssh | 86 | 22 # ssh |
87 | ]; | 87 | ]; |
88 | allowedUDPPorts = [ | ||
89 | 51820 # wireguard | ||
90 | ]; | ||
88 | allowedUDPPortRanges = [ | 91 | allowedUDPPortRanges = [ |
89 | { from = 60000; to = 61000; } # mosh | 92 | { from = 60000; to = 61000; } # mosh |
90 | ]; | 93 | ]; |
diff --git a/modules/yggdrasil-wg/default.nix b/modules/yggdrasil-wg/default.nix index fbb38d26..3bff6458 100644 --- a/modules/yggdrasil-wg/default.nix +++ b/modules/yggdrasil-wg/default.nix | |||
@@ -91,14 +91,11 @@ let | |||
91 | }; | 91 | }; |
92 | linkConfig = { | 92 | linkConfig = { |
93 | MACAddress = "${greHostMACPrefixes.${hostName}}:${hexIx}"; | 93 | MACAddress = "${greHostMACPrefixes.${hostName}}:${hexIx}"; |
94 | RequiredForOnline = false; | ||
94 | }; | 95 | }; |
95 | networkConfig = { | 96 | networkConfig = { |
96 | Tunnel = "yggre-${other}"; | ||
97 | BatmanAdvanced = "yggdrasil"; | 97 | BatmanAdvanced = "yggdrasil"; |
98 | }; | 98 | }; |
99 | linkConfig = { | ||
100 | RequiredForOnline = false; | ||
101 | }; | ||
102 | }; | 99 | }; |
103 | 100 | ||
104 | trim = str: if hasSuffix "\n" str then trim (removeSuffix "\n" str) else str; | 101 | trim = str: if hasSuffix "\n" str then trim (removeSuffix "\n" str) else str; |
@@ -152,6 +149,9 @@ in { | |||
152 | linkConfig = { | 149 | linkConfig = { |
153 | RequiredForOnline = false; | 150 | RequiredForOnline = false; |
154 | }; | 151 | }; |
152 | networkConfig = { | ||
153 | Tunnel = map (opts@{from, to, ...}: let other = if from == hostName then to else from; in "yggre-${other}") hostLinks; | ||
154 | }; | ||
155 | }; | 155 | }; |
156 | yggdrasil = { | 156 | yggdrasil = { |
157 | name = "yggdrasil"; | 157 | name = "yggdrasil"; |