Nftables: add support for nat table

This commit is contained in:
Théophile Bastian 2025-03-08 21:28:23 +01:00
parent c586a58043
commit dbf32dccb6
2 changed files with 16 additions and 0 deletions
roles/nftables
tasks
templates/nftables

View file

@ -16,6 +16,9 @@
- 'filter-input.d'
- 'filter-forward.d'
- 'filter-output.d'
- 'nat-toplevel.d'
- 'nat-prerouting.d'
- 'nat-postrouting.d'
- name: deploy nftables root configuration
template:
src: "nftables/nftables.conf.j2"

View file

@ -48,3 +48,16 @@ table inet filter {
include "/etc/nftables/filter-output.d/*.conf"
}
}
table inet nat {
include "/etc/nftables/nat-toplevel.d/*.conf"
chain prerouting {
type nat hook prerouting priority 100; policy accept;
include "/etc/nftables/nat-prerouting.d/*.conf"
}
chain postrouting {
type nat hook postrouting priority 100; policy accept;
include "/etc/nftables/nat-postrouting.d/*.conf"
}
}