32 lines
594 B
Text
Executable file
32 lines
594 B
Text
Executable file
#!/usr/sbin/nft -f
|
|
|
|
flush ruleset
|
|
|
|
table inet filter {
|
|
chain input {
|
|
type filter hook input priority 0; policy drop;
|
|
|
|
iif lo accept
|
|
|
|
ct state invalid drop
|
|
ct state { established, related } accept
|
|
|
|
# HTTP
|
|
tcp dport { http, https } limit rate 5/second accept
|
|
|
|
# SSH
|
|
tcp dport 995 limit rate 15/minute accept
|
|
|
|
# Allow ICMP
|
|
meta l4proto icmp limit rate 1/second accept
|
|
meta l4proto ipv6-icmp limit rate 1/second accept
|
|
}
|
|
|
|
chain forward {
|
|
type filter hook forward priority 0; policy accept;
|
|
}
|
|
|
|
chain output {
|
|
type filter hook output priority 0; policy accept;
|
|
}
|
|
}
|