Knowledgebase: Dedicated Servers
HOW TO: Check if IP is blocked from IPtables
Posted by on 12 February 2019 11:12 AM

Checking if an IP is blocked in IPTABLES

Check if IP is blocked:


 iptables -L -n --line | grep [IP Address]


If IP appear as DROP or REJECT, the IP has been blocked 


Unblock the IP Address:


iptables -I INPUT -s [IP Address] -j ACCEPT


Blocking back an IP Address:


 iptables -A INPUT -d [IP Address] -j DROP


 service iptables save


To unblock an IP from the CSF from SSH, please follow the steps below:


2. To check if the IP is blocked by CSF, please execute the following command:


csf -g IP_address


Note: IP_address being the specific IP you wish to check.


3. If the IP is denied and you wish to remove it, please execute the following command:


csf -dr IP_address


4. To complete the process, you will need to restart CSF for the changes to take effect:


csf -r


Note: Full path to IPTABLES is /sbin/iptables, you can replace command # iptables with /sbin/iptables

(1 vote(s))
Not helpful

Comments (0)
Copyright © 1998 - 2021 Shinjiru International Inc. All Rights Reserved.