Page 1 of 1

How to check if an IP is blocked in IPTABLES

Posted: Sun Sep 20, 2020 8:05 am
by Jackk
Hello,

How to check if an IP is blocked in IPTABLES?

Re: How to check if an IP is blocked in IPTABLES

Posted: Sun Sep 20, 2020 10:14 am
by Tommy
Hello Jackk,

You can check below command to verify your IP is blocked or not in IPTABLES

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


if IP appears as DROP or REJECT, the IP has been blocked


also you can use the below command to unblock IP


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

Re: How to check if an IP is blocked in IPTABLES

Posted: Sun Sep 20, 2020 10:25 am
by Jackk
Hello Tommy,

Thank you for your reply.

can you please let me know also how to block IP manually using IPTABLES?

Re: How to check if an IP is blocked in IPTABLES

Posted: Sun Sep 20, 2020 10:44 am
by Tommy
Hello Jackk,


Please use the below command to blocking back an IP address in IPTABLES


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