bundles/nftables: add feature to block ips
This commit is contained in:
parent
ee58509e93
commit
bb56f0fb9a
2 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,13 @@ table inet filter {
|
|||
|
||||
iif lo accept
|
||||
|
||||
% for address in sorted(blocked_v4):
|
||||
ip saddr ${address} drop
|
||||
% endfor
|
||||
% for address in sorted(blocked_v6):
|
||||
ip6 saddr ${address} drop
|
||||
% endfor
|
||||
|
||||
icmp type timestamp-request drop
|
||||
icmp type timestamp-reply drop
|
||||
ip protocol icmp accept
|
||||
|
|
|
@ -17,6 +17,8 @@ files = {
|
|||
'/etc/nftables.conf': {
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'blocked_v4': node.metadata.get('nftables/blocked_v4', set()),
|
||||
'blocked_v6': node.metadata.get('nftables/blocked_v6', set()),
|
||||
'forward': node.metadata.get('nftables/forward', {}),
|
||||
'input': node.metadata.get('nftables/input', {}),
|
||||
'postrouting': node.metadata.get('nftables/postrouting', {}),
|
||||
|
|
Loading…
Reference in a new issue