diff options
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/template.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index 55bd04136..e20890e25 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -505,3 +505,18 @@ def nft_state_policy(conf, state): out.append(conf['action']) return " ".join(out) + +@register_filter('nft_intra_zone_action') +def nft_intra_zone_action(zone_conf, ipv6=False): + if 'intra_zone_filtering' in zone_conf: + intra_zone = zone_conf['intra_zone_filtering'] + fw_name = 'ipv6_name' if ipv6 else 'name' + + if 'action' in intra_zone: + if intra_zone['action'] == 'accept': + return 'return' + return intra_zone['action'] + elif dict_search_args(intra_zone, 'firewall', fw_name): + name = dict_search_args(intra_zone, 'firewall', fw_name) + return f'jump {name}' + return 'return' |