v0.0.4
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
---
|
||||
# tasks file for Debian_firewall
|
||||
- name: Copy nftables configuration template
|
||||
template:
|
||||
src: "nftables.conf.j2"
|
||||
dest: /etc/nftables.con
|
||||
|
||||
- name: Enable nftables
|
||||
service:
|
||||
name: nftables
|
||||
|
||||
18
roles/ericomeehan.configure_network/templates/nftables.conf.j2
Executable file
18
roles/ericomeehan.configure_network/templates/nftables.conf.j2
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/sbin/nft -f
|
||||
|
||||
flush ruleset
|
||||
|
||||
table inet filter {
|
||||
chain input {
|
||||
type filter hook input priority filter;
|
||||
{% for port in open_ports %}
|
||||
iifname "{{ port.interface }}" {{ port.protocol }} dport {{ port.port }} accept
|
||||
{% endfor %}
|
||||
}
|
||||
chain forward {
|
||||
type filter hook forward priority filter;
|
||||
}
|
||||
chain output {
|
||||
type filter hook output priority filter;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user