summaryrefslogtreecommitdiff
path: root/data/templates/firewall/nftables-policy.j2
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-12-26 19:19:10 -0600
committerIndrajit Raychaudhuri <irc@indrajit.com>2023-12-26 21:49:42 -0600
commit6278ce9b7cb2060c8226a60ccbdb580a0d8a3fb5 (patch)
tree152db1129e97c9ce15b291090dbdf1f71412aa33 /data/templates/firewall/nftables-policy.j2
parent7c40b70af9def9242b30d1fc949288d9da2bd027 (diff)
downloadvyos-1x-6278ce9b7cb2060c8226a60ccbdb580a0d8a3fb5.tar.gz
vyos-1x-6278ce9b7cb2060c8226a60ccbdb580a0d8a3fb5.zip
firewall: T5834: Add support for default log for route policy
One can now do `set policy route foo default-log` which will add log to the policy route chain.
Diffstat (limited to 'data/templates/firewall/nftables-policy.j2')
-rw-r--r--data/templates/firewall/nftables-policy.j26
1 files changed, 6 insertions, 0 deletions
diff --git a/data/templates/firewall/nftables-policy.j2 b/data/templates/firewall/nftables-policy.j2
index d77e3f6e9..9e28899b0 100644
--- a/data/templates/firewall/nftables-policy.j2
+++ b/data/templates/firewall/nftables-policy.j2
@@ -28,6 +28,9 @@ table ip vyos_mangle {
{{ rule_conf | nft_rule('route', route_text, rule_id, 'ip') }}
{% endfor %}
{% endif %}
+{% if conf.default_log is vyos_defined %}
+ counter log prefix "[ipv4-{{ (route_text)[:19] }}-default]"
+{% endif %}
}
{% endfor %}
{% endif %}
@@ -57,6 +60,9 @@ table ip6 vyos_mangle {
{{ rule_conf | nft_rule('route6', route_text, rule_id, 'ip6') }}
{% endfor %}
{% endif %}
+{% if conf.default_log is vyos_defined %}
+ counter log prefix "[ipv6-{{ (route_text)[:19] }}-default]"
+{% endif %}
}
{% endfor %}
{% endif %}