diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2022-05-12 09:37:47 -0300 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2022-05-27 14:46:58 +0000 |
commit | 2f3fdb9e96a14abf89a32391b44e24b02c3a96f2 (patch) | |
tree | 352fe8b0fa88bfd8bd145489d57e1cec1cf4592f /python/vyos/firewall.py | |
parent | 44326619582f52f5439e301271f728e206e18f8b (diff) | |
download | vyos-1x-2f3fdb9e96a14abf89a32391b44e24b02c3a96f2.tar.gz vyos-1x-2f3fdb9e96a14abf89a32391b44e24b02c3a96f2.zip |
Firewall: T3907: Revert migration script 6-to-7 and add new 7-to-8
Diffstat (limited to 'python/vyos/firewall.py')
-rw-r--r-- | python/vyos/firewall.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py index 0c6811d72..dbe5efcb6 100644 --- a/python/vyos/firewall.py +++ b/python/vyos/firewall.py @@ -146,10 +146,14 @@ def parse_rule(rule_conf, fw_name, rule_id, ip_name): output.append(f'{proto} {prefix}port {operator} $P_{group_name}') - if 'log' in rule_conf: + if 'log' in rule_conf and rule_conf['log'] == 'enable': action = rule_conf['action'] if 'action' in rule_conf else 'accept' - log_level = rule_conf['log'] - output.append(f'log prefix "[{fw_name[:19]}-{rule_id}-{action[:1].upper()}]" level {log_level}') + 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': '<'} |