diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-07-12 17:04:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 17:04:47 +0200 |
commit | 5f638d83a3a24504e51b07f1cafe861c72fd41c1 (patch) | |
tree | 5fb728ed6c254b0ec70d45beaa92c37de71a1eb9 /src/conf_mode/vrf.py | |
parent | 74d6a7e4fc9e2e929c5f899070e6fc3e3e3b5ceb (diff) | |
parent | 52342f389af2da2995b858d026e6fbcad5c8bfaa (diff) | |
download | vyos-1x-5f638d83a3a24504e51b07f1cafe861c72fd41c1.tar.gz vyos-1x-5f638d83a3a24504e51b07f1cafe861c72fd41c1.zip |
Merge pull request #1409 from sever-sever/T4257
vrf: T4527: Prevent to create VRF with reserved names
Diffstat (limited to 'src/conf_mode/vrf.py')
-rwxr-xr-x | src/conf_mode/vrf.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py index 972d0289b..1b4156895 100755 --- a/src/conf_mode/vrf.py +++ b/src/conf_mode/vrf.py @@ -113,8 +113,14 @@ def verify(vrf): f'static routes installed!') if 'name' in vrf: + reserved_names = ["add", "all", "broadcast", "default", "delete", "dev", "get", "inet", "mtu", "link", "type", + "vrf"] table_ids = [] for name, config in vrf['name'].items(): + # Reserved VRF names + if name in reserved_names: + raise ConfigError(f'VRF name "{name}" is reserved and connot be used!') + # table id is mandatory if 'table' not in config: raise ConfigError(f'VRF "{name}" table id is mandatory!') |