summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-07-14 21:48:23 +0200
committerChristian Poessinger <christian@poessinger.com>2022-07-15 07:10:29 +0200
commit81e0f4a8dece85da7169ba05448e870206aaf57b (patch)
tree2743d544601d210600f6b1df15c8a84f611b8ed5 /python
parent3592f56a8deb6c44dcdd7a44ef54fc2c39eb1a3b (diff)
downloadvyos-1x-81e0f4a8dece85da7169ba05448e870206aaf57b.tar.gz
vyos-1x-81e0f4a8dece85da7169ba05448e870206aaf57b.zip
interfaces: T4525: interfaces can not be member of a bridge/bond and a VRF
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configverify.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 438485d98..137eb9f79 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -99,6 +99,18 @@ def verify_vrf(config):
'Interface "{ifname}" cannot be both a member of VRF "{vrf}" '
'and bridge "{is_bridge_member}"!'.format(**config))
+def verify_bond_bridge_member(config):
+ """
+ Checks if interface has a VRF configured and is also part of a bond or
+ bridge, which is not allowed!
+ """
+ if 'vrf' in config:
+ ifname = config['ifname']
+ if 'is_bond_member' in config:
+ raise ConfigError(f'Can not add interface "{ifname}" to bond, it has a VRF assigned!')
+ if 'is_bridge_member' in config:
+ raise ConfigError(f'Can not add interface "{ifname}" to bridge, it has a VRF assigned!')
+
def verify_tunnel(config):
"""
This helper is used to verify the common part of the tunnel