From 326f7259b7dd18a40e9981a7ff6e6ab5d963c7e3 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Wed, 6 May 2020 23:37:31 +0100 Subject: [PATCH] ixvm-fra01: allow disabling peering --- ops/nixos/ixvm-fra01/bird.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ops/nixos/ixvm-fra01/bird.nix b/ops/nixos/ixvm-fra01/bird.nix index c878bcd351..1afd29cabe 100644 --- a/ops/nixos/ixvm-fra01/bird.nix +++ b/ops/nixos/ixvm-fra01/bird.nix @@ -81,8 +81,10 @@ let ipv4 table ${ixName}4; ipv6 table ${ixName}6; '' + 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, ... }: '' protocol bgp ${ixName}${toString routerNum}_4 { + ${enabledSnippet router}; local ${ix.local.v4} as ${toString ix.local.asn}; neighbor ${router.v4} as ${toString ix.remote.asn}; ipv4 { @@ -92,6 +94,7 @@ let }; }; protocol bgp ${ixName}${toString routerNum}_6 { + ${enabledSnippet router}; local ${ix.local.v6} as ${toString ix.local.asn}; neighbor ${router.v6} as ${toString ix.remote.asn}; ipv6 {