diff --git a/tasks/firewall.yaml b/tasks/firewall.yaml index 7e9b697..6077a24 100644 --- a/tasks/firewall.yaml +++ b/tasks/firewall.yaml @@ -3,8 +3,8 @@ # deploy nftables rules - name: "firewall - nftables rules" ansible.builtin.template: - src: "nftables.conf.j2" - dest: "/etc/nftables.conf" + src: "nftables.nft.j2" + dest: "/etc/nftables.nft" mode: "0600" owner: "root" group: "root" diff --git a/templates/nftables.conf.j2 b/templates/nftables.nft.j2 similarity index 94% rename from templates/nftables.conf.j2 rename to templates/nftables.nft.j2 index d2df6af..2d0e955 100644 --- a/templates/nftables.conf.j2 +++ b/templates/nftables.nft.j2 @@ -12,18 +12,15 @@ table inet filter { # Allow loopback iif lo accept - # Allow LAN management access - iif {{ lan_interface }} accept +# Allow ICMP + ip protocol icmp accept + ip6 nexthdr ipv6-icmp accept # Allow incoming firewall rules {% for rule in incoming_firewall_rules %} # {{ rule.name }} iif {{ lan_interface }} ip saddr {{ rule.source }} {{ rule.protocol | default('tcp') }} dport {{ rule.port }} accept {% endfor %} - - # Allow ICMP - ip protocol icmp accept - ip6 nexthdr ipv6-icmp accept } chain forward {