diff options
author | Daniil Baturin <daniil@vyos.io> | 2022-06-10 17:47:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-10 17:47:51 +0300 |
commit | fcad9572e880ab5dd71636e0aa4842dc8997bc44 (patch) | |
tree | 8ab5210f5c4d716cd586ee93d04aeedba723d0ca /python/vyos/firewall.py | |
parent | 865f38d22a072ee129af2044399ec74b262e897a (diff) | |
parent | 2f3fdb9e96a14abf89a32391b44e24b02c3a96f2 (diff) | |
download | vyos-1x-fcad9572e880ab5dd71636e0aa4842dc8997bc44.tar.gz vyos-1x-fcad9572e880ab5dd71636e0aa4842dc8997bc44.zip |
Merge pull request #1322 from nicolas-fort/T3907-fwall-log
Firewall: T3907: add log-level options in firewall
Diffstat (limited to 'python/vyos/firewall.py')
-rw-r--r-- | python/vyos/firewall.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py index b962c4f18..31fe8b5e3 100644 --- a/python/vyos/firewall.py +++ b/python/vyos/firewall.py @@ -217,7 +217,12 @@ def parse_rule(rule_conf, fw_name, rule_id, ip_name): if 'log' in rule_conf and rule_conf['log'] == 'enable': action = rule_conf['action'] if 'action' in rule_conf else 'accept' - output.append(f'log prefix "[{fw_name[:19]}-{rule_id}-{action[:1].upper()}] "') + output.append(f'log prefix "[{fw_name[:19]}-{rule_id}-{action[:1].upper()}]"') + + if 'log_level' in rule_conf: + log_level = rule_conf['log_level'] + output.append(f'level {log_level}') + if 'hop_limit' in rule_conf: operators = {'eq': '==', 'gt': '>', 'lt': '<'} |