From 83c42081d3fb44982b903d032c54eec2beab89ef Mon Sep 17 00:00:00 2001 From: Alex Kudentsov <43482574+alexk37@users.noreply.github.com> Date: Sun, 18 Oct 2026 16:31:05 +0700 Subject: bgp: T9450: render EVPN route-target both as import+export FRR never folds a VRF's l2vpn evpn route-targets back into "both" (bgp_config_write_evpn_info(), bgpd/bgp_evpn_vty.c): it always prints the import list and the export list separately, each from its own flag. Unlike the per-VNI "route-target both" context, tools/frr-reload.py has no special case that folds a matching VRF-wide import+export pair back into "both", so the line was deleted and re-added, both RTs with it, on every reload. Render "route-target both" as its "import"+"export" equivalent so the rendered config matches what FRR will echo back. --- data/templates/frr/bgpd.frr.j2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'data') diff --git a/data/templates/frr/bgpd.frr.j2 b/data/templates/frr/bgpd.frr.j2 index 867c08fcb..1088e737f 100644 --- a/data/templates/frr/bgpd.frr.j2 +++ b/data/templates/frr/bgpd.frr.j2 @@ -480,9 +480,18 @@ router bgp {{ system_as }} {{ 'vrf ' ~ vrf if vrf is vyos_defined }} {{ 'as-nota rt vpn import {{ afi_config.route_target.vpn.import }} {% endif %} {% endif %} +{# T9450: FRR never folds a VRF's l2vpn evpn route-targets back into "both" #} +{# (bgp_config_write_evpn_info(), bgpd/bgp_evpn_vty.c: the import list and the #} +{# export list are each printed from their own flag/list, independently of #} +{# how they were set - unlike the per-VNI "route-target both" context, which #} +{# tools/frr-reload.py folds a matching import+export pair back into "both" #} +{# by a dedicated special case that does not exist for this, VRF-wide, #} +{# context). Rendering "route-target both" here makes frr-reload see it #} +{# missing from the running config and delete+re-add both RTs every reload. #} {% if afi_config.route_target.both is vyos_defined %} {% for route_target in afi_config.route_target.both %} - route-target both {{ route_target }} + route-target import {{ route_target }} + route-target export {{ route_target }} {% endfor %} {% endif %} {% if afi_config.route_target.export is vyos_defined %} -- cgit v1.2.3