From 70ee7d9ccf8db6354c4f3272b0edaf32ad059872 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 4 Aug 2022 00:27:21 +0200 Subject: [PATCH] cluster/services/wireguard: add extra routes --- cluster/services/wireguard/default.nix | 2 ++ cluster/services/wireguard/mesh.nix | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cluster/services/wireguard/default.nix b/cluster/services/wireguard/default.nix index bcebe6f..c3c78ab 100644 --- a/cluster/services/wireguard/default.nix +++ b/cluster/services/wireguard/default.nix @@ -24,6 +24,7 @@ in inherit meshNet; pubKey = "NpeB8O4erGTas1pz6Pt7qtY9k45YV6tcZmvvA4qXoFk="; privKeyFile = ./mesh-keys/VEGAS.age; + extraRoutes = [ "${hosts.VEGAS.interfaces.vstub.addr}/32" "10.10.0.0/16" ]; }; }; mesh-node-prophet = { @@ -33,6 +34,7 @@ in inherit meshNet; pubKey = "MMZAbRtNE+gsLm6DJy9VN/Y39E69oAZnvOcFZPUAVDc="; privKeyFile = ./mesh-keys/prophet.age; + extraRoutes = []; }; }; }; diff --git a/cluster/services/wireguard/mesh.nix b/cluster/services/wireguard/mesh.nix index b29ba4f..c154968 100644 --- a/cluster/services/wireguard/mesh.nix +++ b/cluster/services/wireguard/mesh.nix @@ -8,7 +8,7 @@ let peerLink = cluster.config.links."mesh-node-${peerName}"; in { publicKey = peerLink.extra.pubKey; - allowedIPs = [ "${peerLink.extra.meshIp}/32" ]; + allowedIPs = [ "${peerLink.extra.meshIp}/32" ] ++ peerLink.extra.extraRoutes; endpoint = peerLink.tuple; }; in