summaryrefslogtreecommitdiff
path: root/python/vyos/configverify.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2022-07-18 12:13:26 +0100
committerGitHub <noreply@github.com>2022-07-18 12:13:26 +0100
commit91efb252a73af6f8531a196bda147dca3b0978eb (patch)
tree14b81b1498767a72dbd57d673583391154345fd1 /python/vyos/configverify.py
parent0665732aa91707dcdeff9b94b08fe7fd3f3291b7 (diff)
parent6f53eb48d5c9d79354d4349c042eec02b8051560 (diff)
downloadvyos-1x-91efb252a73af6f8531a196bda147dca3b0978eb.tar.gz
vyos-1x-91efb252a73af6f8531a196bda147dca3b0978eb.zip
Merge pull request #1406 from c-po/equuleus-interface-fixes
equuleus: Bond and Bridge interface fixes + new smoketests
Diffstat (limited to 'python/vyos/configverify.py')
-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 6566e8863..44342f289 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -84,6 +84,18 @@ def verify_mtu_ipv6(config):
tmp = dict_search('ipv6.address.eui64', config)
if tmp != None: raise ConfigError(error_msg)
+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