HOW TO: Check if IP is blocked from IPtables

Last modified: February 24, 2020
You are here:
Estimated reading time: 1 min

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:

Firstly, 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.

Secondly, if the IP is denied and you wish to remove it, please execute the following command:

csf -dr IP_address

Lastly, 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

Was this article helpful?
Dislike 0
Views: 21
Customer Services Contact

Need Help? Send a Ticket to our 24X7 Technical Support Team

Subscribe Newsletter

Subscribe to Casbay Newsletter for online tips, events and latest promotion !

Copyright © 2010 – 2021 Casbay Sdn. Bhd. (1042688-D). All Rights Reserved.

All Trademarks Are The Property of Their Respective Owner.