summaryrefslogtreecommitdiffstats
path: root/lass/2configs/wiregrill.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-01-10 13:20:04 +0100
committermakefu <github@syntax-fehler.de>2023-01-10 13:20:04 +0100
commitc691e94c45e6c5bdac531186374b185ea1790311 (patch)
tree024f2e5b8aed015687f03b31b6e7c1ce743f009c /lass/2configs/wiregrill.nix
parent1929733c03dbff92f830cb81b57cf4ccf859d364 (diff)
parent2818476f710410f1c752ce12becce10be0a8a293 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lass/2configs/wiregrill.nix')
-rw-r--r--lass/2configs/wiregrill.nix21
1 files changed, 14 insertions, 7 deletions
diff --git a/lass/2configs/wiregrill.nix b/lass/2configs/wiregrill.nix
index 54257d2c4..a27e99ee2 100644
--- a/lass/2configs/wiregrill.nix
+++ b/lass/2configs/wiregrill.nix
@@ -16,13 +16,20 @@ in mkIf (hasAttr "wiregrill" config.krebs.build.host.nets) {
krebs.iptables.tables.filter.INPUT.rules = [
{ predicate = "-p udp --dport ${toString self.wireguard.port}"; target = "ACCEPT"; }
];
- krebs.iptables.tables.filter.FORWARD.rules = mkIf isRouter [
- { precedence = 1000; predicate = "-i wiregrill -o wiregrill"; target = "ACCEPT"; }
- { precedence = 1000; predicate = "-i wiregrill -o retiolum"; target = "ACCEPT"; }
- { precedence = 1000; predicate = "-i retiolum -o wiregrill"; target = "ACCEPT"; }
- { precedence = 1000; predicate = "-i wiregrill -o eth0"; target = "ACCEPT"; }
- { precedence = 1000; predicate = "-o wiregrill -m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
- ];
+ krebs.iptables.tables.filter.FORWARD.rules = mkIf isRouter (mkBefore [
+ { predicate = "-i wiregrill -o wiregrill"; target = "ACCEPT"; }
+ { predicate = "-i wiregrill -o retiolum"; target = "ACCEPT"; }
+ { predicate = "-i retiolum -o wiregrill"; target = "ACCEPT"; }
+ { predicate = "-i wiregrill -o eth0"; target = "ACCEPT"; }
+ { predicate = "-o wiregrill -m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
+ ]);
+ systemd.network.networks.wiregrill = {
+ matchConfig.Name = "wiregrill";
+ address =
+ (optional (!isNull self.ip4) "${self.ip4.addr}/16") ++
+ (optional (!isNull self.ip6) "${self.ip6.addr}/48")
+ ;
+ };
networking.wireguard.interfaces.wiregrill = {
ips =