bundles/nftables: store rules in dedicated files instead of nftables.conf
This commit is contained in:
parent
1742f51778
commit
0101e0c92d
11 changed files with 77 additions and 102 deletions
|
@ -19,14 +19,6 @@ table inet filter {
|
|||
ip protocol icmp accept
|
||||
|
||||
ip6 nexthdr ipv6-icmp accept
|
||||
% for ruleset, rules in sorted(node.metadata.get('nftables/rules/input', {}).items()):
|
||||
|
||||
# ${ruleset}
|
||||
% for rule in rules:
|
||||
${rule}
|
||||
% endfor
|
||||
# / ${ruleset}
|
||||
% endfor
|
||||
}
|
||||
|
||||
chain output {
|
||||
|
@ -40,32 +32,15 @@ table inet filter {
|
|||
|
||||
icmp type timestamp-request drop
|
||||
icmp type timestamp-reply drop
|
||||
|
||||
% for ruleset, rules in sorted(node.metadata.get('nftables/rules/forward', {}).items()):
|
||||
|
||||
# ${ruleset}
|
||||
% for rule in rules:
|
||||
${rule}
|
||||
% endfor
|
||||
# / ${ruleset}
|
||||
% endfor
|
||||
}
|
||||
}
|
||||
|
||||
table nat {
|
||||
chain prerouting {
|
||||
type nat hook prerouting priority -100
|
||||
|
||||
% for rule in sorted(node.metadata.get('nftables/rules/nat_prerouting', [])):
|
||||
${rule}
|
||||
% endfor
|
||||
}
|
||||
chain postrouting {
|
||||
type nat hook postrouting priority 100
|
||||
|
||||
% for rule in sorted(node.metadata.get('nftables/rules/nat_postrouting', [])):
|
||||
${rule}
|
||||
% endfor
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue