-
Notifications
You must be signed in to change notification settings - Fork 1
/
firewall.nft
30 lines (22 loc) · 848 Bytes
/
firewall.nft
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain INPUT {
type filter hook input priority 0; policy drop;
tcp flags & (fin|syn) == (fin|syn) drop
tcp flags & (syn|rst) == (syn|rst) drop
tcp flags & (fin|syn|rst|psh|ack|urg) < (fin) drop
tcp flags & (fin|syn|rst|psh|ack|urg) == (fin|psh|urg) drop
ip frag-off & 8191 != 0 counter packets 0 bytes 0 drop
iif lo accept comment "localhost traffic"
ct state established,related accept comment "traffic originated from us"
ct state invalid counter drop comment "drop invalid packets"
tcp dport { 22,35123 } ct state new accept
}
chain FORWARD {
type filter hook forward priority 0; policy drop;
}
chain OUTPUT {
type filter hook output priority 0; policy accept;
}
}