How to iptables allow one ips so further blocks wont be counted?

Discussion in 'Linux Networking' started by postcd, Jul 9, 2014.

  1. postcd

    postcd Member

    Messages:
    65
    Likes Received:
    5
    Trophy Points:
    8
    Hello,

    i dont know how? but on my OpenVZ host server and on my VPS, my Google nameserver IPs (ones i have set in /etc/resolv.conf - 8.8.8.8 and 8.8.4.4) were blocked in both iptables.

    so i want to prevent these to be blocked in future even when a block rule is added. I mean i want to ask how i can add iptables whitelist rule for these IPs which will overide any further block rules for these IPs? Thank you

  2. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,260
    Likes Received:
    429
    Trophy Points:
    83
    Something like this?
    Code:
    iptables -I INPUT -s <allowed_ip> -j ACCEPT
    iptables -P INPUT DROP
  3. VitalkaDrug

    VitalkaDrug New Member

    Messages:
    25
    Likes Received:
    16
    Trophy Points:
    3
    Possibly these IPs were added to the block not accidentally.
    Often the attackers use these IPs as source IP for DDoS.
    I think you should investigate this issue...

    Could you clarify which chain do you use to add blocking rules?
    Your task is to place allowing rules before blocking rules in this chain.
    ryanvade likes this.

Share This Page