diff options
author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-01 19:50:21 +0200 |
---|---|---|
committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-04 22:59:39 +0200 |
commit | f5ebaaa3ea3091f3228c509991c06300269883ef (patch) | |
tree | d20a39cf5e0e417b02f70db49ab05189bb561244 /src/conf_mode/interfaces-tunnel.py | |
parent | ee58d8ef363d989ab7c63441b84489a6c45cfc31 (diff) | |
download | vyos-1x-f5ebaaa3ea3091f3228c509991c06300269883ef.tar.gz vyos-1x-f5ebaaa3ea3091f3228c509991c06300269883ef.zip |
tunnel: T2241: make VRF and bridge membership mutually exclusive
Diffstat (limited to 'src/conf_mode/interfaces-tunnel.py')
-rwxr-xr-x | src/conf_mode/interfaces-tunnel.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py index 1916d2de2..363daaf4f 100755 --- a/src/conf_mode/interfaces-tunnel.py +++ b/src/conf_mode/interfaces-tunnel.py @@ -525,10 +525,15 @@ def verify(conf): print(f'Should not use IPv6 addresses on tunnel {iftype} {ifname}') # vrf check - - vrf = options['vrf'] - if vrf and vrf not in options['interfaces']: - raise ConfigError(f'VRF "{vrf}" does not exist') + if options['vrf']: + if options['vrf'] not in options['interfaces']: + raise ConfigError(f'VRF "{options["vrf"]}" does not exist') + + if options['bridge']: + raise ConfigError(( + f'Interface "{options["ifname"]}" cannot be member of VRF ' + f'"{options["vrf"]}" and bridge {options["bridge"]} ' + f'at the same time!')) # source-interface check |