How to Block an ip address using iptables

On January 21, 2010, in block, ip, iptables, by Dipin Krishna

You can block an user with an ip address from accessing your system using the iptables.

For that follow these steps.

1. Open up a shell and login as root.

2. now type the command below to block the ip(XXX.XXX.XXX.XXX).

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

3. See whether the new rule has been added.

# /sbin/iptables -L -n

You can find other options to choose from with the following command:

# iptables --help
 

Leave a Reply

*

Search