firewall/modules/module-rate-limit-ip.sh
Your Name 9866774da8 fix
2024-09-25 14:27:07 -06:00

7 lines
468 B
Bash

#!/bin/bash
NFT='/usr/bin/nft'
$NFT add set ip filter rateLimit { type ipv4_addr \; flags dynamic, timeout \; timeout 5m \; }
$NFT add set ip6 filter rateLimit { type ipv6_addr \; flags dynamic, timeout \; timeout 5m \; }
$NFT add rule filter input ip protocol tcp ct state new, untracked limit rate over 100/minute add @rateLimit { ip saddr }
$NFT add rule filter input ip6 protocol tcp ct state new, untracked limit rate over 100/minute add @rateLimit { ip6 saddr }