Blocking an IP with .htaccess

Discussion in 'Apache' started by Kat2, Feb 2, 2006.

  1. #1
    Hi all, I need to block someone from loading my website. The IP and other stats are here.

    First of all, I don't know whether the person's IP is dynamic or static. If I block the entire IP address (e.g. 69.208.71.131) will that be sufficient? Or should I block 69.208.71. ? If I leave that last octet blank, how many users do I risk locking out of my website? Can I presume that it's safer to block that way than blocking by ISP name?

    Finally, do I need to add anything to the .htaccess file other than the line:

    deny from (IP here)

    Thanks!
     
    Kat2, Feb 2, 2006 IP
  2. gordonfreeman

    gordonfreeman Peon

    Messages:
    169
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    well you have the following options:

    1. block only that ip, and check if other ips close to it visit your site (usually the last class.. so 69.208.71.0-255, except 131 which you blocked).. if they don't, it should mean that the ip is static

    2. block class D from that ip, which should be 69.208.71.0/24, which blockes 69.208.71.0-255 (that means 256 ips).. this is good if it has a dynamic ip, and the host allocates ips only from the 71 C class to that area

    3. block *.dsl.klmzmi.ameritech.net, which will assure that the user, even if he has a dynamic ip, won't be able to load the page.. however, this will block a lot more ips (depending on how many ips does ameritech.net have for dsl)
     
    gordonfreeman, Feb 2, 2006 IP
  3. Kat2

    Kat2 Well-Known Member

    Messages:
    143
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Okay, so for now I have blocked just that IP. I saw one site about .htaccess that showed some additional code saying "order allow,deny" - do I need to add that or is just the deny line fine?
     
    Kat2, Feb 2, 2006 IP
  4. gordonfreeman

    gordonfreeman Peon

    Messages:
    169
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if it's just that ip that you're blocking, you should be ok..
     
    gordonfreeman, Feb 3, 2006 IP