diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-08-17 22:05:21 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-08-17 22:05:21 +0200 |
commit | 053f586fa7a5a69b3b6be81339c73d8550d67fc6 (patch) | |
tree | 79ff91d32208596573b5a50fc315acde05cae0ba /src/conf_mode | |
parent | da453ff4a810463febacdba7246d19ac6075b9b7 (diff) | |
download | vyos-1x-053f586fa7a5a69b3b6be81339c73d8550d67fc6.tar.gz vyos-1x-053f586fa7a5a69b3b6be81339c73d8550d67fc6.zip |
bgp: T3759: add l3vpn "import vrf" commands
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/protocols_bgp.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py index fb128db7b..7fc4a2247 100755 --- a/src/conf_mode/protocols_bgp.py +++ b/src/conf_mode/protocols_bgp.py @@ -23,6 +23,7 @@ from vyos.config import Config from vyos.configdict import dict_merge from vyos.configverify import verify_prefix_list from vyos.configverify import verify_route_map +from vyos.configverify import verify_vrf from vyos.template import is_ip from vyos.template import is_interface from vyos.template import render_to_string @@ -238,6 +239,16 @@ def verify(bgp): raise ConfigError('Missing mandatory configuration option for '\ f'{afi} administrative distance {key}!') + if afi in ['ipv4_unicast', 'ipv6_unicast']: + if 'import' in afi_config and 'vrf' in afi_config['import']: + # Check if VRF exists + verify_vrf(afi_config['import']['vrf']) + + # FRR error: please unconfigure vpn to vrf commands before + # using import vrf commands + 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!') return None def generate(bgp): |