summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-05 17:20:30 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-05 17:20:30 +0100
commitd860d2f136e92c2bb959ad3c6dd9db70da0480b6 (patch)
treea578c288c926d45ea23811e92af0795876bb652d
parent4a8a3e1325bcfe4f6fcbb328cdd1eb67b3b0d86a (diff)
downloadvyos-1x-d860d2f136e92c2bb959ad3c6dd9db70da0480b6.tar.gz
vyos-1x-d860d2f136e92c2bb959ad3c6dd9db70da0480b6.zip
vxlan: T1636: ensure 'link' interface really exists
-rwxr-xr-xsrc/conf_mode/interfaces-vxlan.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-vxlan.py b/src/conf_mode/interfaces-vxlan.py
index dabfe4836..c9ef0fe9c 100755
--- a/src/conf_mode/interfaces-vxlan.py
+++ b/src/conf_mode/interfaces-vxlan.py
@@ -134,8 +134,11 @@ def verify(vxlan):
if vxlan['mtu'] < 1500:
print('WARNING: RFC7348 recommends VXLAN tunnels preserve a 1500 byte MTU')
- if vxlan['group'] and not vxlan['link']:
- raise ConfigError('Multicast VXLAN requires an underlaying interface ')
+ if vxlan['group']:
+ if not vxlan['link']:
+ raise ConfigError('Multicast VXLAN requires an underlaying interface ')
+ if not vxlan['link'] in interfaces():
+ raise ConfigError('VXLAN source interface does not exist')
if not (vxlan['group'] or vxlan['remote']):
raise ConfigError('Group or remote must be configured')