summaryrefslogtreecommitdiff
path: root/data/templates/firewall/nftables.j2
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2022-09-05 14:43:08 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2022-09-13 11:59:12 +0200
commit30945f39d6d1f0fdba34ce1c2d887a1a6823ecbe (patch)
treeca9b4d04f2245870a44ee73592ee0e1d7b85c40d /data/templates/firewall/nftables.j2
parent24e5529be7b5a28868a666dabae0a1d61e6a5c15 (diff)
downloadvyos-1x-30945f39d6d1f0fdba34ce1c2d887a1a6823ecbe.tar.gz
vyos-1x-30945f39d6d1f0fdba34ce1c2d887a1a6823ecbe.zip
zone-policy: T2199: Migrate zone-policy to firewall node
Diffstat (limited to 'data/templates/firewall/nftables.j2')
-rw-r--r--data/templates/firewall/nftables.j215
1 files changed, 9 insertions, 6 deletions
diff --git a/data/templates/firewall/nftables.j2 b/data/templates/firewall/nftables.j2
index dde88d09d..c0780dad5 100644
--- a/data/templates/firewall/nftables.j2
+++ b/data/templates/firewall/nftables.j2
@@ -1,6 +1,7 @@
#!/usr/sbin/nft -f
{% import 'firewall/nftables-defines.j2' as group_tmpl %}
+{% import 'firewall/nftables-zone.j2' as zone_tmpl %}
{% if first_install is not vyos_defined %}
delete table ip vyos_filter
@@ -93,6 +94,10 @@ table ip vyos_filter {
{{ group_tmpl.groups(group, False) }}
+{% if zone is vyos_defined %}
+{{ zone_tmpl.zone_chains(zone, state_policy is vyos_defined, False) }}
+{% endif %}
+
{% if state_policy is vyos_defined %}
chain VYOS_STATE_POLICY {
{% if state_policy.established is vyos_defined %}
@@ -107,9 +112,6 @@ table ip vyos_filter {
return
}
{% endif %}
-{% if zone_conf is vyos_defined %}
- include "{{ zone_conf }}"
-{% endif %}
}
{% if first_install is not vyos_defined %}
@@ -195,6 +197,10 @@ table ip6 vyos_filter {
{{ group_tmpl.groups(group, True) }}
+{% if zone is vyos_defined %}
+{{ zone_tmpl.zone_chains(zone, state_policy is vyos_defined, True) }}
+{% endif %}
+
{% if state_policy is vyos_defined %}
chain VYOS_STATE_POLICY6 {
{% if state_policy.established is vyos_defined %}
@@ -209,7 +215,4 @@ table ip6 vyos_filter {
return
}
{% endif %}
-{% if zone6_conf is vyos_defined %}
- include "{{ zone6_conf }}"
-{% endif %}
}