summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-12-17 08:30:18 +0100
committerGitHub <noreply@github.com>2022-12-17 08:30:18 +0100
commit8637b02bb60baf499fc63696c28aa1af3559c308 (patch)
tree9037a1bfa13db97f8b0dd9f4e020beee8dd10f32 /data/templates
parentd7a67aa4a7e7bb82a60ad18103abc6b966a2f8b8 (diff)
parent9a5dfb4b7ec9e065a73511a38e1713aec03eee0e (diff)
downloadvyos-1x-8637b02bb60baf499fc63696c28aa1af3559c308.tar.gz
vyos-1x-8637b02bb60baf499fc63696c28aa1af3559c308.zip
Merge pull request #1626 from nicolas-fort/fwall_group_interface
T4780: Firewall: add firewall groups in firewall. Extend matching cri…
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/firewall/nftables-defines.j213
1 files changed, 13 insertions, 0 deletions
diff --git a/data/templates/firewall/nftables-defines.j2 b/data/templates/firewall/nftables-defines.j2
index dd06dee28..0a7e79edd 100644
--- a/data/templates/firewall/nftables-defines.j2
+++ b/data/templates/firewall/nftables-defines.j2
@@ -85,5 +85,18 @@
}
{% endfor %}
{% endif %}
+{% if group.interface_group is vyos_defined %}
+{% for group_name, group_conf in group.interface_group.items() %}
+{% set includes = group_conf.include if group_conf.include is vyos_defined else [] %}
+ set I_{{ group_name }} {
+ type ifname
+ flags interval
+ auto-merge
+{% if group_conf.interface is vyos_defined or includes %}
+ elements = { {{ group_conf.interface | nft_nested_group(includes, group.interface_group, 'interface') | join(",") }} }
+{% endif %}
+ }
+{% endfor %}
+{% endif %}
{% endif %}
{% endmacro %}