How do I use iptables to block or drop an IP address that is attacking my server?
If you want to block access to your Linux server, you can use iptables. iptables comes standard with almost all linux distros. You have to log in and su to root.
In this example, the attacking IP is 64.38.244.72:
Type the command "iptables -A INPUT -s 64.38.244.72/32 -j DROP"
If you want to block access to a single port from an ip:
Type the command "iptables -A INPUT -s 64.38.244.72/32 -p tcp --destination-port 80 -j DROP"
This will drop all packets from 64.38.244.72/32 to port 80 (http) on the server.
Categories:
New Articles: