summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-05-10 16:36:21 +0200
committerGitHub <noreply@github.com>2024-05-10 16:36:21 +0200
commitd93aedfe993a6e9868ee88803c2dc981cabdfc15 (patch)
tree9d1977454f35746adc20df4f7c1b7739f176f3b6 /src
parent4960a67e12c1d10a59812f0167f017131a9617b5 (diff)
parentbced1b4ef04f9e1a12c083c08839e4c1a54e2549 (diff)
downloadvyos-1x-d93aedfe993a6e9868ee88803c2dc981cabdfc15.tar.gz
vyos-1x-d93aedfe993a6e9868ee88803c2dc981cabdfc15.zip
Merge pull request #3441 from vyos/mergify/bp/sagitta/pr-3410
Bond: T6303: add system mac address on interfaces bond (backport #3410)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_bonding.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces_bonding.py b/src/conf_mode/interfaces_bonding.py
index 371b219c0..5e5d5fba1 100755
--- a/src/conf_mode/interfaces_bonding.py
+++ b/src/conf_mode/interfaces_bonding.py
@@ -33,6 +33,7 @@ from vyos.ifconfig import BondIf
from vyos.ifconfig.ethernet import EthernetIf
from vyos.ifconfig import Section
from vyos.template import render_to_string
+from vyos.utils.assertion import assert_mac
from vyos.utils.dict import dict_search
from vyos.utils.dict import dict_to_paths_values
from vyos.utils.network import interface_exists
@@ -244,6 +245,16 @@ def verify(bond):
raise ConfigError('primary interface only works for mode active-backup, ' \
'transmit-load-balance or adaptive-load-balance')
+ if 'system_mac' in bond:
+ if bond['mode'] != '802.3ad':
+ raise ConfigError('Actor MAC address only available in 802.3ad mode!')
+
+ system_mac = bond['system_mac']
+ try:
+ assert_mac(system_mac, test_all_zero=False)
+ except:
+ raise ConfigError(f'Cannot use a multicast MAC address "{system_mac}" as system-mac!')
+
return None
def generate(bond):