When your Linux server gets bombarded with malicious requests the quickest and easiest thing is to block the offending IP address (or the entire range) using iptables:

To block just one IP address:

$ sudo iptables -A INPUT -s 103.10.86.53 -j DROP

To block 103.10.86.* addresses:

$ sudo iptables -A INPUT -s 103.10.86.0/24 -j DROP

To block 103.10.*.* addresses:

$ sudo iptables -A INPUT -s 103.10.0.0/16 -j DROP

To block 103.*.*.* addresses:

$ sudo iptables -A INPUT -s 103.0.0.0/8 -j DROP

Note: Be careful not to unintentionally block legitimate traffic from reaching your server.

List the rules for the INPUT chain:

$ sudo iptables -L INPUT -v
Block a range of IP addresses from reaching your server

Leave a Reply

Your email address will not be published. Required fields are marked *

*