bgpwtf: edge01: repurpose wireguard tunnel for fmt
Change-Id: Ib36048a83641b62210ad0d63b7b7ecda999da542
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1201
Reviewed-by: q3k <q3k@hackerspace.pl>
diff --git a/bgpwtf/machines/modules/routing.nix b/bgpwtf/machines/modules/routing.nix
index 50f5ff8..ac222a9 100644
--- a/bgpwtf/machines/modules/routing.nix
+++ b/bgpwtf/machines/modules/routing.nix
@@ -140,6 +140,9 @@
default = false;
description = "Interface is stub (do not HELLO).";
};
+ neighbors = mkOption {
+ type = listOf str;
+ };
};
});
description = "Interface configuration";
@@ -160,11 +163,18 @@
ip = if v4 then "4" else "6";
name = "ospf_${af}_${n}";
- interfaces = mapAttrsToList (iface: ifaceConfig: ''
+ interfaces = mapAttrsToList (iface: ifaceConfig: let
+ neighbors = ''
+ neighbors {
+ ${concatStringsSep "\n" (map (n: "${n};") ifaceConfig.neighbors)}
+ };
+ '';
+ in ''
interface "${iface}" {
type ${ifaceConfig.type};
cost ${toString ifaceConfig.cost};
${if ifaceConfig.stub then "stub yes;" else ""}
+ ${if ifaceConfig.type == "ptmp" then neighbors else ""}
};
'');
areas = mapAttrsToList (area: areaConfig: ''