-2

每天一次,以下 IP 范围每秒发送多个请求。在攻击期间,使用了一个奇怪的浏览器,如下所述:

IP Range: 192.168.1.100-192.168.1.200
Port: 80 (Apache web server)   
Browser Name: X11: Crawler

在其他时候,我收到来自提到的 IP 愤怒的合法流量(使用其他浏览器)。因此,我无法完全阻止此 IP 范围。

我想将聚合连接(仅提到的 IP 范围)限制为 15/分钟。以下 iptable 规则是否正确?

iptables -A INPUT -p tcp --syn  --dport 80    
-m string    --algo bm --string "X11: Crawler"  \    
-m iprange   --src-range 192.168.1.100-192.168.1.200  \    
-m connlimit --connlimit-above 15/minute --connlimit-mask 32  \    
-j REJECT --reject-with tcp-reset 
4

1 回答 1

0

我认为这行得通

iptables -A INPUT -p tcp --destination-port 80 -m iprange --src-range 192.168.1.100-192.168.1.200 -j ACCEPT

如果您想禁止 IP 范围更改 ACCEPT 与 DROP

于 2018-09-18T05:27:56.210 回答