If you need to check if an IP address is blocked in iptables, use the following command
iptables -L -n --line-numbers | grep $IPADDRESS
Replace $IPADDRESS with the IP address you need to check
If you need to remove a block, you need to know 2 things. The chain name that the block is set in, and the line number.
The command above should give you an output like this:
iptables -L -n --line-numbers | grep 192.168.0.1
Chain INPUT (policy DROP)
num target prot opt source destination
1 DROP all -- 192.168.0.1 0.0.0.0/0
In this case, the chain name is “INPUT”, and the line number is 1. So to remove this block, run this command
iptables -D INPUT 1
This will remove line 1 from the INPUT chain.