From 27770ae19ec6afa1f6ffe39cbea8c711dbabe2d7 Mon Sep 17 00:00:00 2001 From: lare Date: Tue, 23 Apr 2024 17:29:23 +0200 Subject: [PATCH] [node] also try ipv6ll in bgp-config [frontend] don't show enh v6 on --- nodes/templates/bgp-peer.template.conf | 4 ++-- web/backend/main.py | 1 + web/frontend/peerings-edit.html | 4 ++-- web/frontend/peerings-new.html | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/nodes/templates/bgp-peer.template.conf b/nodes/templates/bgp-peer.template.conf index f8c6df4..2236dd7 100644 --- a/nodes/templates/bgp-peer.template.conf +++ b/nodes/templates/bgp-peer.template.conf @@ -9,7 +9,7 @@ protocol bgp dn42_{{peering["MNT"][:-4].lower()}}_{{peering["ASN"][-4:]}} from d #import where dn42_import_filter(x,y,z); #export where dn42_export_filter(x,y,z); #} - extended next hop {% if peering["bgp_enh"] %}on{%else%}off{%endif%}; + extended next hop off; }; ipv6 { {# TODO: implement pinging peer for bgp-communities @@ -28,7 +28,7 @@ protocol bgp dn42_{{peering["MNT"][:-4].lower()}}_{{peering['ASN'][-4:]}}_4 from }; protocol bgp dn42_{{peering["MNT"][:-4].lower()}}_{{peering['ASN'][-4:]}}_6 from dnpeers { - neighbor {{peering["ipv6"]}} as {{peering["ASN"]}}; + neighbor {% if "ipv6" in peering.keys() %}{{peering["ipv6"]}}{% else %}{{peering["ipv6ll"]}}{% endif %} as {{peering["ASN"]}}; passive off; #import where dn42_import_filter(x,y,z); #export where dn42_export_filter(x,y,z); diff --git a/web/backend/main.py b/web/backend/main.py index 2c6b506..659de5b 100644 --- a/web/backend/main.py +++ b/web/backend/main.py @@ -392,6 +392,7 @@ def peerings_new(): if not peering_valid: return render_template("peerings-new.html", session=session, config=config, peerings=peerings, msg=peering_or_msg), 400 success, code = peerings.add_peering(session["user-data"]["asn"], request.args["node"], session["user-data"]["mnt"], peering_or_msg["peer-wgkey"], peering_or_msg["peer-endpoint"], peering_or_msg["peer-v6ll"], peering_or_msg["peer-v4"], peering_or_msg["peer-v6"], peering_or_msg["bgp-mp"], peering_or_msg["bgp-enh"]) + print(f"{success}, {code}") if not success: return render_template("peerings-new.html", session=session, config=config, peerings=peerings, msg="this ASN already has a peering with the requested node or something failed in the backend, please retry later"), code diff --git a/web/frontend/peerings-edit.html b/web/frontend/peerings-edit.html index 9d98782..b304b08 100644 --- a/web/frontend/peerings-edit.html +++ b/web/frontend/peerings-edit.html @@ -155,7 +155,7 @@ let enh_anabled = document.getElementById("bgp-extended-next-hop").checked; if (enh_anabled) { example_config_bird2_enh4.innerHTML = "on"; - example_config_bird2_enh6.innerHTML = "on"; + //example_config_bird2_enh6.innerHTML = "on"; } else { example_config_bird2_enh4.innerHTML = "off"; example_config_bird2_enh6.innerHTML = "off"; @@ -266,7 +266,7 @@ protocol bgp dn42_{{config["MNT"][:-4].lower()}} from dnpeers { extended next hop on; }; ipv6 { - extended next hop on; + extended next hop off; }; } diff --git a/web/frontend/peerings-new.html b/web/frontend/peerings-new.html index 9d2e638..b72eeea 100644 --- a/web/frontend/peerings-new.html +++ b/web/frontend/peerings-new.html @@ -155,7 +155,7 @@ let enh_anabled = document.getElementById("bgp-extended-next-hop").checked; if (enh_anabled) { example_config_bird2_enh4.innerHTML = "on"; - example_config_bird2_enh6.innerHTML = "on"; + //example_config_bird2_enh6.innerHTML = "on"; } else { example_config_bird2_enh4.innerHTML = "off"; example_config_bird2_enh6.innerHTML = "off"; @@ -263,7 +263,7 @@ protocol bgp dn42_{{config["MNT"][:-4].lower()}} from dnpeers { extended next hop on; }; ipv6 { - extended next hop on; + extended next hop off; }; }