summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-vxlan.py
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 19:54:53 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:39 +0200
commit1a170e9172eac154322c49d8c196e09f5804bc4a (patch)
tree9c063e1494c184ff43d331bf47ed49d4ed1ac99a /src/conf_mode/interfaces-vxlan.py
parentdd50da5f22d18745adafb482ae19ac2455f86cba (diff)
downloadvyos-1x-1a170e9172eac154322c49d8c196e09f5804bc4a.tar.gz
vyos-1x-1a170e9172eac154322c49d8c196e09f5804bc4a.zip
vxlan: T2241: make address and bridge membership mutually exclusive
Bridge members should not have any addresses assigned.
Diffstat (limited to 'src/conf_mode/interfaces-vxlan.py')
-rwxr-xr-xsrc/conf_mode/interfaces-vxlan.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-vxlan.py b/src/conf_mode/interfaces-vxlan.py
index 334e418ab..5bf1f2fb6 100755
--- a/src/conf_mode/interfaces-vxlan.py
+++ b/src/conf_mode/interfaces-vxlan.py
@@ -122,7 +122,8 @@ def get_config():
vxlan['ipv6_eui64_prefix'] = conf.return_values('ipv6 address eui64')
# Remove the default link-local address if set.
- if not conf.exists('ipv6 address no-default-link-local'):
+ if not ( conf.exists('ipv6 address no-default-link-local')
+ or vxlan['is_bridge_member'] ):
# add the link-local by default to make IPv6 work
vxlan['ipv6_eui64_prefix'].append('fe80::/64')
@@ -194,6 +195,14 @@ def verify(vxlan):
raise ConfigError('VXLAN has a 50 byte overhead, underlaying device ' \
'MTU is to small ({})'.format(underlay_mtu))
+ if ( vxlan['is_bridge_member']
+ and ( vxlan['address']
+ or vxlan['ipv6_eui64_prefix']
+ or vxlan['ipv6_autoconf'] ) ):
+ raise ConfigError((
+ f'Cannot assign address to interface "{vxlan["intf"]}" '
+ f'as it is a member of bridge "{vxlan["is_bridge_member"]}"!'))
+
return None