Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 6 of 6

This is a discussion on Blocking IP ranges or Countries in the VPS & Dedicated forum
Is there a way to limit connection per IP (on apache?)???? I've had a TON of junk, hack attepts...etc comming from Germany and Australia lately. ...

  1. #1
    JPC Member
    Join Date
    May 2006
    Posts
    12

    Blocking IP ranges or Countries

    Is there a way to limit connection per IP (on apache?)????

    I've had a TON of junk, hack attepts...etc comming from Germany and Australia lately.

    The stuff on my VPS is stricly local to US and as far as I'm concerned I dont care if other countries can ever get to it. How do I go about blocking IP ranges ?

    I looked at this thread:

    and found this
    /sbin/iptables -A INPUT -s IP_TO_BLOCK -j DROP; /sbin/service iptables save

    but when I try to ad an IP address I get a nice little error:
    iptables v1.2.11: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
    Perhaps iptables or your kernel needs to be upgraded.


    Additionaly i'm not sure how I add a range of IPs to block.

    Any help would be greatful.
    Last edited by AWD_ENVY; 09-04-2006 at 01:53 PM.

  2. #2
    JPC Support Smithjp's Avatar
    Join Date
    Jun 2006
    Location
    Planet Earth
    Posts
    166
    How do I go about blocking IP ranges ?
    The recommended appraoch is to have apf and bfd installed on the VPS. bfd works with apf and search the logs for fail login attempts and block those Ips on the server.

    iptables v1.2.11: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
    Perhaps iptables or your kernel needs to be upgraded.
    iptables modules need to be enabled for your VPS. Please open a support ticket to get them enabled for your VPS.

  3. #3
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,648
    A VPS may be different, but I would think you could do this with your .htaccess file using something like this.
    <Files 403.shtml>
    order allow,deny
    allow from all
    </Files>
    deny from 64.12.0.0 - 64.12.255.255

    Forum Moderators - Jag Staff

    Spam Whackers Blog - Dedicated to fighting Spam and providing General SEO Tips
    Organize your Kitchen or purchase Kitchen Accessories at Condells
    Ihelpyou Forum - Dedicated to "Best Practices" SEO

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Heh!

    Yeah, you can ban countries. I've banned about half of China, for instance, with a couple of IP ranges -- as described by Connie...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    On VPS he has the option to make these blocks on a lower level. That way connections from such IPs take (even) less resources and give (even) less chances to hack something.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  6. #6
    JPC Member
    Join Date
    Sep 2006
    Posts
    9
    When you get iptables setup use it like this:

    iptables -I INPUT -s 55.55.55.55 -j DROP
    This will block the ip 55.55.55.55

    iptables -I INPUT -s 55.55.55.0/24 -j DROP
    To block a range of ip's , you use netmask, like above it will block the entire "block c" range.

    Now all you have to do ( a lot of work ) is type in all the ip ranges for Germany ( i have attached a list for you).

    REMEMBER to save the iptables rules, it only stores it in memory, so if you reset everything is lost, so remember this:

    iptables save

    If your problem is mainly hacking attempts, you could just ask support to get APF installed , it will block any ip's using iptables that are trying to "Brute Force" hack your system.

    Also install "Mod Security" it will also stop some hack attempts.
    Attached Files Attached Files
    best regards Preben Eriksen,

    Get traffic from Txtswap or Topsites 2, Hang out at Webmasters Meet

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •