summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2026-06-26 10:23:54 +0300
committerOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2026-06-26 10:28:05 +0300
commit4e11adfb927c22e2f977c897d56a4d243860e877 (patch)
tree18123b28269b111c135b7488f0055081e27f5726 /src/conf_mode
parent477b1b9137ef42407e18b68684485ae623834456 (diff)
downloadvyos-1x-4e11adfb927c22e2f977c897d56a4d243860e877.tar.gz
vyos-1x-4e11adfb927c22e2f977c897d56a4d243860e877.zip
bgp: T8865: Reject `vni` sub-block in VRF l2vpn-evpn when `advertise-all-vni` is globally active
When `advertise-all-vni` is configured in the global/default BGP instance, VyOS generated a `vni <id>` sub-block under each VRF BGP `address-family l2vpn evpn` context. This conflicts with advertise-all-vni: FRR already owns all kernel VNIs and returns `% Failed to create VNI` when frr-reload.py attempts to apply the VRF-level vni sub-block. FRR then performs an early exit from config processing, silently dropping the entire l2vpn evpn address-family for all subsequent VRF BGP instances.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 2ec631f4c..bde6fcdd0 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -647,6 +647,29 @@ def verify(config_dict):
if 'route_target' in vni_config and 'advertise_all_vni' not in afi_config:
raise ConfigError('BGP EVPN "route-target" requires "advertise-all-vni" to be set!')
+ # T8865: Detect conflict between VRF-level "vni" sub-block and global
+ # "advertise-all-vni". When advertise-all-vni is active in the default
+ # BGP instance, FRR already owns all VNIs discovered from the kernel.
+ # Attempting to create the same VNI again via a VRF BGP "vni" sub-block
+ # causes FRR to return "% Failed to create VNI" and perform an early exit
+ # from config processing.
+ if vrf and 'vni' in afi_config:
+ default_bgp_evpn = dict_search(
+ 'dependent_vrfs.default.protocols.bgp.address_family.l2vpn_evpn',
+ bgp,
+ )
+ if (
+ default_bgp_evpn is not None
+ and 'deleted' not in default_bgp_evpn
+ ):
+ if 'advertise_all_vni' in default_bgp_evpn:
+ raise ConfigError(
+ 'BGP EVPN "vni" sub-configuration conflicts with '
+ '"advertise-all-vni" in the default BGP instance. '
+ 'Remove "vni" from the VRF l2vpn-evpn configuration '
+ 'or disable "advertise-all-vni" for the default BGP.'
+ )
+
return None
def generate(config_dict):