From a9738a94e009610163e3c49e9686c12051917af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 1 Apr 2024 12:14:45 +0200 Subject: nixos: few more fixes --- nixos/modules/wireguad.nix | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'nixos/modules/wireguad.nix') diff --git a/nixos/modules/wireguad.nix b/nixos/modules/wireguad.nix index d96fc9e..ca28818 100644 --- a/nixos/modules/wireguad.nix +++ b/nixos/modules/wireguad.nix @@ -81,18 +81,47 @@ in { IPForward = is_endpoint; }; routes = - (optional (hostName != "spt-omnia") { + (optional (hostName != "lipwig") { + # OpenVPN network + routeConfig = { + Gateway = config.cynerd.hosts.wg.lipwig; + Destination = "10.8.0.0/24"; + Metric = 2048; + }; + }) + ++ (optional (hostName != "spt-omnia") { + # SPT network routeConfig = { Gateway = config.cynerd.hosts.wg.spt-omnia; Destination = "10.8.2.0/24"; + Metric = 2048; }; }) ++ (optional (hostName != "adm-omnia" && hostName != "lipwig") { + # Adamkovi network routeConfig = { Gateway = config.cynerd.hosts.wg.adm-omnia; Destination = "10.8.3.0/24"; + Metric = 2048; }; - }); + }) + ++ (optionals (hostName != "dean") [ + # Elektroline + { + routeConfig = { + Gateway = config.cynerd.hosts.wg.dean; + Destination = "10.0.0.0/22"; + Metric = 2048; + }; + } + { + routeConfig = { + Gateway = config.cynerd.hosts.wg.dean; + Destination = "10.0.20.0/24"; + Metric = 2048; + }; + } + ]); }; }; networking.firewall.allowedUDPPorts = [51820]; -- cgit v1.2.3