dn42: allow for multiprotocol="ipv4"

This commit is contained in:
Astro 2022-02-10 18:12:33 +01:00
parent 39c7a9bf1f
commit 4df5d4cda5
2 changed files with 6 additions and 6 deletions

View File

@ -350,11 +350,11 @@
]
},
"locked": {
"lastModified": 1642963136,
"narHash": "sha256-h/C8HnGVJLxnYbI/WUrD4F/YXN3uI8d+zY2QWt2PrTc=",
"lastModified": 1644512129,
"narHash": "sha256-bdJS7RrYenDaS1ZgkL+yNUmHbgV1dWOqKfvuxuitYDg=",
"ref": "master",
"rev": "4a5aba5a32695015c9b7a4a1f3648d3d8e34a91d",
"revCount": 120,
"rev": "3b17877a7c41946277af91d46a800a298d3e6b09",
"revCount": 121,
"type": "git",
"url": "ssh://gitea@gitea.c3d2.de/c3d2-admins/secrets.git"
},

View File

@ -126,13 +126,13 @@ in {
bgpNeighbors = builtins.concatStringsSep "\n" (builtins.attrValues
(builtins.mapAttrs (name: conf@{ multiprotocol ? false, ... }:
let
neighbor4 = if conf ? address4 && !multiprotocol then ''
neighbor4 = if conf ? address4 && multiprotocol != "ipv6" then ''
protocol bgp ${name}_4 from dnpeers {
neighbor ${conf.address4} as ${builtins.toString conf.asn};
}
'' else
"";
neighbor6 = if conf ? address6 then ''
neighbor6 = if conf ? address6 && multiprotocol != "ipv4" then ''
protocol bgp ${name}_6 from dnpeers {
neighbor ${conf.address6}%${interface} as ${
builtins.toString conf.asn