summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-18 14:06:00 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-18 14:06:00 +0200
commit47261d051759a743a36089aa0be7cecd348710c1 (patch)
tree38b4923e942c212c91ba59a2cdd25efc782054b5 /src
parent522402ecb797222e69f6017a84d1b65cfdc5c70e (diff)
downloadvyos-1x-47261d051759a743a36089aa0be7cecd348710c1.tar.gz
vyos-1x-47261d051759a743a36089aa0be7cecd348710c1.zip
bgp: evpn: T1513: VNI rt and rd are only supported under EVPN VRF
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 7fc4a2247..bc7acaf6c 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -249,6 +249,16 @@ def verify(bgp):
if 'vpn' in afi_config['import'] or dict_search('export.vpn', afi_config) != None:
raise ConfigError('Please unconfigure VPN to VRF commands before '\
'using "import vrf" commands!')
+
+ if afi in ['l2vpn_evpn'] and 'vrf' not in bgp:
+ # Some L2VPN EVPN AFI options are only supported under VRF
+ if 'vni' in afi_config:
+ for vni, vni_config in afi_config['vni'].items():
+ if 'rd' in vni_config:
+ raise ConfigError('VNI route-distinguisher is only supported under EVPN VRF')
+ if 'route_target' in vni_config:
+ raise ConfigError('VNI route-target is only supported under EVPN VRF')
+
return None
def generate(bgp):