summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces_bonding.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-03-30 21:29:26 +0200
committerGitHub <noreply@github.com>2026-03-30 21:29:26 +0200
commit03b412fd9ca754f3ea61c8c7c210babf4aa4d251 (patch)
tree85f96d1c79a924c5142dbe98c0de7eb235d318c9 /src/conf_mode/interfaces_bonding.py
parent7a0b2775278338902631ea8bfe51170d5119a876 (diff)
parent2f0ef2bfe9d36228795ae46eee23031a37ab5957 (diff)
downloadvyos-1x-03b412fd9ca754f3ea61c8c7c210babf4aa4d251.tar.gz
vyos-1x-03b412fd9ca754f3ea61c8c7c210babf4aa4d251.zip
Merge pull request #5086 from natali-rs1985/T8419
vpp: T8419: Disallow cross-membership between VPP and kernel bonding/bridge interfaces
Diffstat (limited to 'src/conf_mode/interfaces_bonding.py')
-rwxr-xr-xsrc/conf_mode/interfaces_bonding.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces_bonding.py b/src/conf_mode/interfaces_bonding.py
index 4d6cafc9d..55581d6ad 100755
--- a/src/conf_mode/interfaces_bonding.py
+++ b/src/conf_mode/interfaces_bonding.py
@@ -44,6 +44,7 @@ from vyos.configdict import has_address_configured
from vyos.configdict import has_vrf_configured
from vyos.configdep import set_dependents
from vyos.configdep import call_dependents
+from vyos.vpp.utils import cli_ifaces_list
from vyos import ConfigError
from vyos import airbag
airbag.enable()
@@ -170,6 +171,8 @@ def get_config(config=None):
if 'static_arp' in bond:
set_dependents('static_arp', conf)
+ bond['vpp_ifaces'] = cli_ifaces_list(conf)
+
return bond
@@ -205,7 +208,7 @@ def verify(bond):
bond_name = bond['ifname']
if dict_search('member.interface', bond):
for interface, interface_config in bond['member']['interface'].items():
- error_msg = f'Can not add interface "{interface}" to bond, '
+ error_msg = f'Cannot add interface "{interface}" to bond, '
if interface == 'lo':
raise ConfigError('Loopback interface "lo" can not be added to a bond')
@@ -239,6 +242,12 @@ def verify(bond):
continue
raise ConfigError(error_msg + f'it has a "{option_path.replace(".", " ")}" assigned!')
+ iface_base = interface.split('.')[0] # get the parent interface name
+ if iface_base in bond['vpp_ifaces']:
+ raise ConfigError(
+ error_msg + 'it is already configured as VPP interface'
+ )
+
if mtu := bond.get('mtu'):
mtu = int(mtu)
max_mtu = int(EthernetIf(interface).get_max_mtu())