summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-11-20 12:22:38 +0100
committerChristian Poessinger <christian@poessinger.com>2020-11-20 12:54:49 +0100
commit4eef27f0e8345341805949d72c1b2949551fb467 (patch)
tree9e2b33c70f190042e35e460f7adfb24658936ef9 /src
parent246808bc33a2343827ab2b4d76ae449fcc549ac9 (diff)
downloadvyos-1x-4eef27f0e8345341805949d72c1b2949551fb467.tar.gz
vyos-1x-4eef27f0e8345341805949d72c1b2949551fb467.zip
tunnel: T3072: interfaces used for NHRP can not be deleted
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces-tunnel.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py
index 461ac38ce..78fc9667c 100755
--- a/src/conf_mode/interfaces-tunnel.py
+++ b/src/conf_mode/interfaces-tunnel.py
@@ -62,12 +62,21 @@ def get_config(config=None):
if 'mtu' not in tmp:
tunnel['mtu'] = '1476'
+ # We must check if our interface is configured to be a DMVPN member
+ nhrp_base = ['protocols', 'nhrp', 'tunnel']
+ conf.set_level(nhrp_base)
+ nhrp = conf.get_config_dict([], key_mangling=('-', '_'), get_first_key=True)
+ if nhrp: tunnel.update({'nhrp' : list(nhrp.keys())})
+
return tunnel
def verify(tunnel):
if 'deleted' in tunnel:
verify_bridge_delete(tunnel)
- # TODO: check for NHRP tunnel member
+
+ if 'nhrp' in tunnel and tunnel['ifname'] in tunnel['nhrp']:
+ raise ConfigError('Tunnel used for NHRP, it can not be deleted!')
+
return None
if 'encapsulation' not in tunnel: