summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-tunnel.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-30 22:29:23 +0200
committerGitHub <noreply@github.com>2021-08-30 22:29:23 +0200
commit9711774ee7c00c9f0a113fecc50d64036937937c (patch)
tree4f10b0578440fb29e30b28e02cf63d1ce39b8fe5 /src/conf_mode/interfaces-tunnel.py
parent705022319916222d78082114245c7639c073bd32 (diff)
parent5c29377fa91595088118419275f6d05b1fbfbd1d (diff)
downloadvyos-1x-9711774ee7c00c9f0a113fecc50d64036937937c.tar.gz
vyos-1x-9711774ee7c00c9f0a113fecc50d64036937937c.zip
Merge pull request #984 from sever-sever/T3786
tunnel: T3786: Add checks for source any and not key
Diffstat (limited to 'src/conf_mode/interfaces-tunnel.py')
-rwxr-xr-xsrc/conf_mode/interfaces-tunnel.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py
index 294da8ef9..616a2e23c 100755
--- a/src/conf_mode/interfaces-tunnel.py
+++ b/src/conf_mode/interfaces-tunnel.py
@@ -94,6 +94,12 @@ def verify(tunnel):
if 'direction' not in tunnel['parameters']['erspan']:
raise ConfigError('ERSPAN version 2 requires direction to be set!')
+ # If tunnel source address any and key not set
+ if tunnel['encapsulation'] in ['gre'] and \
+ tunnel['source_address'] == '0.0.0.0' and \
+ dict_search('parameters.ip.key', tunnel) == None:
+ raise ConfigError('Tunnel parameters ip key must be set!')
+
verify_mtu_ipv6(tunnel)
verify_address(tunnel)
verify_vrf(tunnel)