diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-09-17 21:16:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-17 21:16:40 +0200 |
commit | dcf755594d3ce63239af407f71ceae295a12ed75 (patch) | |
tree | ba46fd714927010c7f7f4ccc1fae2e8fa11c1a75 /python/vyos/template.py | |
parent | a4feb96af9ac45aff41ded1744cf302b5c5a9e7e (diff) | |
parent | 99155150df9ceed0be4df46351844451b0683b3b (diff) | |
download | vyos-1x-dcf755594d3ce63239af407f71ceae295a12ed75.tar.gz vyos-1x-dcf755594d3ce63239af407f71ceae295a12ed75.zip |
Merge pull request #1546 from nicolas-fort/fwall-jump
T4699: Firewall: Add jump action in firewall ruleset
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r-- | python/vyos/template.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index 4281fb34f..0e79994f5 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -548,7 +548,7 @@ def nft_rule(rule_conf, fw_name, rule_id, ip_name='ip'): return parse_rule(rule_conf, fw_name, rule_id, ip_name) @register_filter('nft_default_rule') -def nft_default_rule(fw_conf, fw_name): +def nft_default_rule(fw_conf, fw_name, ipv6=False): output = ['counter'] default_action = fw_conf['default_action'] @@ -557,6 +557,11 @@ def nft_default_rule(fw_conf, fw_name): output.append(f'log prefix "[{fw_name[:19]}-default-{action_suffix}]"') output.append(nft_action(default_action)) + if 'default_jump_target' in fw_conf: + target = fw_conf['default_jump_target'] + def_suffix = '6' if ipv6 else '' + output.append(f'NAME{def_suffix}_{target}') + output.append(f'comment "{fw_name} default-action {default_action}"') return " ".join(output) |