Block IPs via iptables
Login | Register RSS
01/09/2012 - Linux 

Block IPs via iptables

You will need to run these commands as 'root'.

This command blocks IP "123.123.123.123" at the firewall.

iptables -I INPUT -s 123.123.123.123 -j DROP

This command lists all the IPs currently blocked at the firewall

iptables -L INPUT -n --line-numbers

This command would remove line #3 from the firewall

iptables -D RH-Firewall-1-INPUT 3

This command saves the changes to the firewall

iptables-save


If you like this site or any of its content, please help promote it. Use the social media buttons below to help spread the word. Don't forget to post in the comments section.

  Print   Email