diff options
| author | Roman Khramshin <HollyGurza@users.noreply.github.com> | 2024-11-21 13:41:10 +0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-21 09:41:10 +0200 |
| commit | b51cf400b42d7b2d05237169a813d1e952213558 (patch) | |
| tree | 12fe95038495b36d7d008400ae0b039430b051e4 /python/vyos/qos | |
| parent | 1a291b44716ae268916a95971016fb0cf9584ba0 (diff) | |
| download | veeos-1x-b51cf400b42d7b2d05237169a813d1e952213558.tar.gz veeos-1x-b51cf400b42d7b2d05237169a813d1e952213558.zip | |
T6796: QoS: match filter by interface(iif) (#4188)
Diffstat (limited to 'python/vyos/qos')
| -rw-r--r-- | python/vyos/qos/base.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/python/vyos/qos/base.py b/python/vyos/qos/base.py index 322cdca44..35cc5be18 100644 --- a/python/vyos/qos/base.py +++ b/python/vyos/qos/base.py @@ -17,6 +17,7 @@ import os import jmespath from vyos.base import Warning +from vyos.ifconfig import Interface from vyos.utils.process import cmd from vyos.utils.dict import dict_search from vyos.utils.file import read_file @@ -253,7 +254,7 @@ class QoSBase: for index, (match, match_config) in enumerate(cls_config['match'].items(), start=1): filter_cmd = filter_cmd_base if not has_filter: - for key in ['mark', 'vif', 'ip', 'ipv6']: + for key in ['mark', 'vif', 'ip', 'ipv6', 'interface']: if key in match_config: has_filter = True break @@ -263,9 +264,14 @@ class QoSBase: if 'mark' in match_config: mark = match_config['mark'] filter_cmd += f' handle {mark} fw' + if 'vif' in match_config: vif = match_config['vif'] filter_cmd += f' basic match "meta(vlan mask 0xfff eq {vif})"' + elif 'interface' in match_config: + iif_name = match_config['interface'] + iif = Interface(iif_name).get_ifindex() + filter_cmd += f' basic match "meta(rt_iif eq {iif})"' for af in ['ip', 'ipv6']: tc_af = af |
