From 8b0db3ac7fc71d10747a77582a94788a0f9e12e5 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sat, 16 Dec 2023 13:00:10 +0000 Subject: [PATCH] nixos/home/routing-common: Add route to other router's public IPv4 --- nixos/boxes/home/routing-common/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nixos/boxes/home/routing-common/default.nix b/nixos/boxes/home/routing-common/default.nix index eb653a5..1c9e9c6 100644 --- a/nixos/boxes/home/routing-common/default.nix +++ b/nixos/boxes/home/routing-common/default.nix @@ -6,6 +6,7 @@ let inherit (lib.my.c.home) domain vlans prefixes routers routersPubV4; name = elemAt routers index; + otherIndex = 1 - index; in { nixos.systems."${name}" = { @@ -258,6 +259,17 @@ in (mkVLANConfig "hi" 9000) (mkVLANConfig "lo" 1500) (mkVLANConfig "untrusted" 1500) + + { + "60-lan-hi" = { + routes = map (r: { routeConfig = r; }) [ + { + Destination = elemAt routersPubV4 otherIndex; + Gateway = net.cidr.host (otherIndex + 1) prefixes.hi.v4; + } + ]; + }; + } ]; };