diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-10-23 16:40:18 +0000 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-10-23 16:40:18 +0000 |
commit | a9e93ef54bd38fd86268ce9e1c581a3852692280 (patch) | |
tree | b84073c9ca60f2501ea64eb1f20051778f6c0100 /python/vyos/template.py | |
parent | 2007a883125c7c6e1a0a1b06b0e0d32f9b1dc693 (diff) | |
download | vyos-1x-a9e93ef54bd38fd86268ce9e1c581a3852692280.tar.gz vyos-1x-a9e93ef54bd38fd86268ce9e1c581a3852692280.zip |
T5637: Firewall: add new rule at the end of base chains for default-actions. This enables logs capabilities for default-action in base chains.
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r-- | python/vyos/template.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index e167488c6..320abe256 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -582,10 +582,11 @@ def nft_rule(rule_conf, fw_hook, fw_name, rule_id, ip_name='ip'): def nft_default_rule(fw_conf, fw_name, ipv6=False): output = ['counter'] default_action = fw_conf['default_action'] + family = 'ipv6' if ipv6 else 'ipv4' if 'enable_default_log' in fw_conf: action_suffix = default_action[:1].upper() - output.append(f'log prefix "[{fw_name[:19]}-default-{action_suffix}]"') + output.append(f'log prefix "[{family}-{fw_name[:19]}-default-{action_suffix}]"') #output.append(nft_action(default_action)) output.append(f'{default_action}') |