Checking if an IP is blocked in IPTABLES

How to check if IP is blocked from 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

Click Here to view the video tutorial for doing this.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How To Install and Use Docker on Ubuntu 16.04

Introduction Docker is an application that makes it simple and easy to run application processes...

Change Main IP of the server :: Vesta Panel

If we are changing the main IP of a server installed with Vesta panel, we can use the following...

cPanel: Apache-FastCGI Data Timeout Error

If you are using a cPanel server and have FastCGI enabled in Apache, you might be facing the...

Domainkey installer in cPanel

You can use the following cPanel script to install domainkey for an account...

Email issues :: Common Troubleshooting Steps

Here I will discuss some common errors and their solution: We are using a mail relay setup for...