BLOCK a range of IP Addresses in IPTABLES

Discussion in 'Site & Server Administration' started by ketan9, Feb 4, 2009.

  1. #1
    I want to block the ip address in an odd range like from
    88.147.196.0 - 88.147.253.255

    I know that if I want to block 88.147.196.0 to 88.147.196.255 then I can use 88.147.196.0/24 to block this range but how do I block above range? What is the mask I need to use..
     
    ketan9, Feb 4, 2009 IP
  2. sarkozy1

    sarkozy1 Active Member

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #2
    sarkozy1, Feb 4, 2009 IP
  3. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #3
    Using .htaccess you can block it following way:

    deny from 88.147.196/253

    Not sure about blocking ip range using IPtable.

    Kailash
     
    kailash, Feb 5, 2009 IP
  4. w0tan

    w0tan Peon

    Messages:
    77
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    
    /sbin/iptables -I INPUT -s 88.147.196.0/88.147.253.255 -j DROP
    
    Code (markup):
    should do it.
     
    w0tan, Feb 5, 2009 IP
  5. ketan9

    ketan9 Active Member

    Messages:
    548
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Hey, that worked like a charm.. Thank you so much..
     
    ketan9, Feb 6, 2009 IP