diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-03-23 10:40:06 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-07 09:44:35 +0200 |
commit | 4ecf558f53d1740b5ddb0de1f7effbaf0f44ff5f (patch) | |
tree | e5895f747ec46e3c8da972928b5f9d9fb6277443 /python | |
parent | 37c6d9fae5172b0342f94212e6483b3aa8fcd673 (diff) | |
download | vyos-1x-4ecf558f53d1740b5ddb0de1f7effbaf0f44ff5f.tar.gz vyos-1x-4ecf558f53d1740b5ddb0de1f7effbaf0f44ff5f.zip |
qos: T4284: support mirror and redirect on vlan subinterfaces
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configverify.py | 19 | ||||
-rwxr-xr-x | python/vyos/ifconfig/interface.py | 3 |
2 files changed, 13 insertions, 9 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index df2c5775a..9f2771854 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -317,9 +317,12 @@ def verify_vlan_config(config): if duplicate: raise ConfigError(f'Duplicate VLAN id "{duplicate[0]}" used for vif and vif-s interfaces!') + parent_ifname = config['ifname'] # 802.1q VLANs - for vlan in config.get('vif', {}): - vlan = config['vif'][vlan] + for vlan_id in config.get('vif', {}): + vlan = config['vif'][vlan_id] + vlan['ifname'] = f'{parent_ifname}.{vlan_id}' + verify_dhcpv6(vlan) verify_address(vlan) verify_vrf(vlan) @@ -327,16 +330,20 @@ def verify_vlan_config(config): verify_mtu_parent(vlan, config) # 802.1ad (Q-in-Q) VLANs - for s_vlan in config.get('vif_s', {}): - s_vlan = config['vif_s'][s_vlan] + for s_vlan_id in config.get('vif_s', {}): + s_vlan = config['vif_s'][s_vlan_id] + s_vlan['ifname'] = f'{parent_ifname}.{s_vlan_id}' + verify_dhcpv6(s_vlan) verify_address(s_vlan) verify_vrf(s_vlan) verify_mirror_redirect(s_vlan) verify_mtu_parent(s_vlan, config) - for c_vlan in s_vlan.get('vif_c', {}): - c_vlan = s_vlan['vif_c'][c_vlan] + for c_vlan_id in s_vlan.get('vif_c', {}): + c_vlan = s_vlan['vif_c'][c_vlan_id] + c_vlan['ifname'] = f'{parent_ifname}.{s_vlan_id}.{c_vlan_id}' + verify_dhcpv6(c_vlan) verify_address(c_vlan) verify_vrf(c_vlan) diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 76164ca32..1464b2969 100755 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1734,6 +1734,3 @@ class VLANIf(Interface): return None return super().set_admin_state(state) - - def set_mirror_redirect(self): - return |