diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-06-15 20:03:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-15 20:03:47 +0200 |
commit | eab40258869631b38b4787816c84efb14fc75ad3 (patch) | |
tree | 1ba9e60f390495ccab46e00934d5c78f2e52865d /data/templates/firewall/nftables.j2 | |
parent | 609a3abb3d9b60daf0bdd5e3733791d520322802 (diff) | |
parent | 7e59b2a3f31edd4793264876d87af725771a222d (diff) | |
download | vyos-1x-eab40258869631b38b4787816c84efb14fc75ad3.tar.gz vyos-1x-eab40258869631b38b4787816c84efb14fc75ad3.zip |
Merge pull request #1361 from sarthurdev/firewall_named
firewall: T4147: Use named sets for firewall groups
Diffstat (limited to 'data/templates/firewall/nftables.j2')
-rw-r--r-- | data/templates/firewall/nftables.j2 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/data/templates/firewall/nftables.j2 b/data/templates/firewall/nftables.j2 index 961b83301..b91fed615 100644 --- a/data/templates/firewall/nftables.j2 +++ b/data/templates/firewall/nftables.j2 @@ -1,13 +1,13 @@ #!/usr/sbin/nft -f +{% import 'firewall/nftables-defines.j2' as group_tmpl %} + {% if cleanup_commands is vyos_defined %} {% for command in cleanup_commands %} {{ command }} {% endfor %} {% endif %} -include "/run/nftables_defines.conf" - table ip filter { {% if first_install is vyos_defined %} chain VYOS_FW_FORWARD { @@ -47,7 +47,7 @@ table ip filter { {% endfor %} {% if group is vyos_defined and group.domain_group is vyos_defined %} {% for name, name_config in group.domain_group.items() %} - set {{ name }} { + set D_{{ name }} { type ipv4_addr flags interval } @@ -69,6 +69,9 @@ table ip filter { {% endfor %} {% endif %} {% endif %} + +{{ group_tmpl.groups(group, False) }} + {% if state_policy is vyos_defined %} chain VYOS_STATE_POLICY { {% if state_policy.established is vyos_defined %} @@ -138,6 +141,9 @@ table ip6 filter { {% endfor %} {% endif %} {% endif %} + +{{ group_tmpl.groups(group, True) }} + {% if state_policy is vyos_defined %} chain VYOS_STATE_POLICY6 { {% if state_policy.established is vyos_defined %} |