1) What is the best way how to check if IP address is blocked by a firewall?
I know this method:
iptables -L -n --line | grep 111.222.333.444
However, if the firewall has blocked an IP address range, for example, 111.222.333.444/19 but I search for 111.222.333.456, it will not return any results. How can I find check specific IP address if a whole range is blocked?
2) If firewall has blocked some IP address, what does mean the first and the second line in the search results:
489 DROP all -- 11.222.333.444/19 0.0.0.0/0 490 DROP all -- 0.0.0.0/0 11.222.333.444/19
How can I unblock IP address or IP address range? Is it correct?:
iptables -I INPUT -s 111.222.333.444 -j ACCEPT
(I want just unblock, not to put in a whitelist).
3) Is this correct if I want to block an IP address in my server?
iptables -A INPUT -d 111.222.333.444 -j DROP
Do I need to restart/reload ... firewall after blocking/unblocking IP addreses?