Search code examples
linuxfirewalliptables

How to find all ip addresses blocked by iptables -A


Without meaning to do so, I probqbly block Ip Address of Googlebot using iptables -A INPUT -s xxx -j DROP. That's maybe the reason why my web site is not referenced by Google. Question: As I don't know which Ip is google's, So How to find the log of iptables and accept all Ip blocked using iptables -D INPUT -s xxx -j DROP ?


Solution

  • try the following command in Linux

    iptables -L INPUT -v -n
    

    You can search for specific IP by using GREP

    iptables -L INPUT -v -n | grep "192.168.2.1"