summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-03 21:02:10 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:39 +0200
commit9998768f0c8edb3e72566f1d26bee67d42adc133 (patch)
treeab3dfff6874d46bd5f8f5bb499abda6277622883 /src
parentd3ac208e936caa172c575c953d3e8582286f70ef (diff)
downloadvyos-1x-9998768f0c8edb3e72566f1d26bee67d42adc133.tar.gz
vyos-1x-9998768f0c8edb3e72566f1d26bee67d42adc133.zip
bonding: T2241: make address and bridge membership mutually exclusive
Bridge members should not have addresses assigned.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces-bonding.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-bonding.py b/src/conf_mode/interfaces-bonding.py
index ec9e0bb11..e5626ef6c 100755
--- a/src/conf_mode/interfaces-bonding.py
+++ b/src/conf_mode/interfaces-bonding.py
@@ -185,6 +185,14 @@ def verify(bond):
raise ConfigError('Mode dependency failed, primary not supported ' \
'in mode "{}"!'.format(bond['mode']))
+ if ( bond['is_bridge_member']
+ and ( bond['address']
+ or bond['ipv6_eui64_prefix']
+ or bond['ipv6_autoconf'] ) ):
+ raise ConfigError((
+ f'Cannot assign address to interface "{bond["intf"]}" '
+ f'as it is a member of bridge "{bond["is_bridge_member"]}"!'))
+
if bond['vrf']:
if bond['vrf'] not in interfaces():
raise ConfigError(f'VRF "{bond["vrf"]}" does not exist')