diff --git a/roles/nftables_front/templates/nftables.conf.j2 b/roles/nftables_front/templates/nftables.conf.j2 index 4aca4d6..3136a88 100644 --- a/roles/nftables_front/templates/nftables.conf.j2 +++ b/roles/nftables_front/templates/nftables.conf.j2 @@ -4,13 +4,14 @@ # Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing. flush ruleset + {% for V in ['4', '6'] %} {% set v = V | replace('4', '') %} {% macro trust(list) %} {% for net in list.split(' ') %} {% if not net is match('127(?:\.\d{1,3}){3}(?:/\d+)?|::1|^$') %} {% if (net is match('\d{1,3}(?:\.\d{1,3}){3}(?:/\d+)?') - and V == '4') or (net | search(':') and V == '6') %} + and V == '4') or (net is search(':') and V == '6') %} {{caller(net)}} {% endif %} {% endif %}