summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-l2tpv3.py
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 18:45:33 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:39 +0200
commitc63ee72e797d29a756c413174ada98d301631bac (patch)
tree792403a307c9520b401b32c23468a74be8715dac /src/conf_mode/interfaces-l2tpv3.py
parentf25f65e38ecde122409534bdc648b768e89b8c8f (diff)
downloadvyos-1x-c63ee72e797d29a756c413174ada98d301631bac.tar.gz
vyos-1x-c63ee72e797d29a756c413174ada98d301631bac.zip
l2tpv3: T2241: make address and bridge membership mutually exclusive
Bridge members should not have any addresses assigned.
Diffstat (limited to 'src/conf_mode/interfaces-l2tpv3.py')
-rwxr-xr-xsrc/conf_mode/interfaces-l2tpv3.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-l2tpv3.py b/src/conf_mode/interfaces-l2tpv3.py
index 1f249c5d0..90a7ecdc8 100755
--- a/src/conf_mode/interfaces-l2tpv3.py
+++ b/src/conf_mode/interfaces-l2tpv3.py
@@ -119,7 +119,8 @@ def get_config():
l2tpv3['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
+ l2tpv3['is_bridge_member'] ):
# add the link-local by default to make IPv6 work
l2tpv3['ipv6_eui64_prefix'].append('fe80::/64')
@@ -194,6 +195,14 @@ def verify(l2tpv3):
if not l2tpv3['peer_session_id']:
raise ConfigError(f'Must configure the l2tpv3 peer-session-id for {interface}')
+ if ( l2tpv3['is_bridge_member']
+ and ( l2tpv3['address']
+ or l2tpv3['ipv6_eui64_prefix']
+ or l2tpv3['ipv6_autoconf'] ) ):
+ raise ConfigError((
+ f'Cannot assign address to interface "{l2tpv3["intf"]}" '
+ f'as it is a member of bridge "{l2tpv3["is_bridge_member"]}"!'))
+
return None