User Tools

Site Tools


server-administration:blocking-using-iptables

This is an old revision of the document!


Blocking IP Addresses using IPtables

The following article describes various ways to block IPs using the built-in RedHat firewall, iptables. The following command will drop all incoming connections from IP xx.xx.xx.xx:

# iptables -I INPUT -s xx.xx.xx.xx -j DROP

To block a range, such as xx.xx.xx.* specify the CIDR block as follows:

# iptables -I INPUT -s xx.xx.xx.0/24 -j DROP

If you wanted to later remove this entry you would replace the -I with -D as follows:

# iptables -D INPUT -s xx.xx.xx.xx -j DROP
# iptables -D INPUT -s xx.xx.xx.0/24 -j DROP

server-administration/blocking-using-iptables.1255560992.txt.gz · Last modified: by garrett.plasky

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki