ixvm-fra01: allow disabling peering

This commit is contained in:
Luke Granger-Brown 2020-05-06 23:37:31 +01:00
parent f27ec35837
commit 326f7259b7

View file

@ -81,8 +81,10 @@ let
ipv4 table ${ixName}4; ipv4 table ${ixName}4;
ipv6 table ${ixName}6; ipv6 table ${ixName}6;
'' + lib.concatImapStringsSep "\n" ( i: v: generateSnippetForRouter (args // { routerNum = i; router = v; }) ) ix.remote.routers; '' + lib.concatImapStringsSep "\n" ( i: v: generateSnippetForRouter (args // { routerNum = i; router = v; }) ) ix.remote.routers;
enabledSnippet = { enabled ? true, ... }: "disabled ${if enabled then "off" else "on"};";
generateSnippetForRouter = { ixName, ix, routerNum, router, ... }: '' generateSnippetForRouter = { ixName, ix, routerNum, router, ... }: ''
protocol bgp ${ixName}${toString routerNum}_4 { protocol bgp ${ixName}${toString routerNum}_4 {
${enabledSnippet router};
local ${ix.local.v4} as ${toString ix.local.asn}; local ${ix.local.v4} as ${toString ix.local.asn};
neighbor ${router.v4} as ${toString ix.remote.asn}; neighbor ${router.v4} as ${toString ix.remote.asn};
ipv4 { ipv4 {
@ -92,6 +94,7 @@ let
}; };
}; };
protocol bgp ${ixName}${toString routerNum}_6 { protocol bgp ${ixName}${toString routerNum}_6 {
${enabledSnippet router};
local ${ix.local.v6} as ${toString ix.local.asn}; local ${ix.local.v6} as ${toString ix.local.asn};
neighbor ${router.v6} as ${toString ix.remote.asn}; neighbor ${router.v6} as ${toString ix.remote.asn};
ipv6 { ipv6 {