引用:
iptables -N ratelimit
iptables -A ratelimit -p tcp -m state –state ESTABLISHED,RELATED -j ACCEPT
iptables -A ratelimit -p tcp –syn -m limit –limit 1/m –limit-burst 1 -j ACCEPT
iptables -A ratelimit -p tcp -j LOG –log-level "NOTICE" –log-prefix "[ratelimit]"
iptables -A ratelimit -p tcp -j DROP
iptables -A INPUT -p tcp –dport 22 -j ratelimit–limit 1/s – 每秒一次
–limit-burst 1 – 允許觸發limit限制的最大次數
留言