How do I block an IP on my server?
Posted by - NA -, Last modified by on 15 July 2009 03:03 PM
If you want to block access to your server for whatever reason, you will need to log into the shell as root. Your server should either have ipchains or iptables to help accomplish this.

In this example, the attacking IP is .

If you are using ipchains, type "ipchains -A input -j DENY -p all -l -s"
If you are using iptables, type "iptables -A INPUT -s -j DROP"

If you just want to block access to one port from an ip :

iptables -A INPUT -s -p tcp --destination-port 23 -j DROP

The above would drop all packets from to port 23 (telnet) on the server.

There are many indepth tutorials available on the internet, search for some more information on it.

Powered by TurnKey Internet]]>