nixos/home/routing-common: Add route to other router's public IPv4
This commit is contained in:
parent
cc07964fac
commit
8b0db3ac7f
@ -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;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user