nixos/home/routing-common: Add route to other router's public IPv4

This commit is contained in:
Jack O'Sullivan 2023-12-16 13:00:10 +00:00
parent cc07964fac
commit 8b0db3ac7f

View File

@ -6,6 +6,7 @@ let
inherit (lib.my.c.home) domain vlans prefixes routers routersPubV4; inherit (lib.my.c.home) domain vlans prefixes routers routersPubV4;
name = elemAt routers index; name = elemAt routers index;
otherIndex = 1 - index;
in in
{ {
nixos.systems."${name}" = { nixos.systems."${name}" = {
@ -258,6 +259,17 @@ in
(mkVLANConfig "hi" 9000) (mkVLANConfig "hi" 9000)
(mkVLANConfig "lo" 1500) (mkVLANConfig "lo" 1500)
(mkVLANConfig "untrusted" 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;
}
];
};
}
]; ];
}; };