Results 1 to 3 of 3
  1. #1

    limit connections per ip per time period

    I have at least one user that seems to be using a "web page change
    checker" program but he has it set to check every 30-seconds. This
    eating up bandwidth and if more people do it, it could be a problem.

    What is a good way to limit connections to x connections per y time
    period by IP and I'd like to show a lower bandwidth page with an explanation.

    Is this possible? Thanks!

  2. #2
    Join Date
    Apr 2003
    Los Angeles, CA
    While this probably isn't a ready to go solution for you, it might put you on the right track. You can use iptables to limit packets/unit time. Essentially you want something like this:

    iptables -I INPUT -p tcp -s SOURCE_IP --dport 80 -i eth0 -m state --state NEW -m recent --set

    iptables -I INPUT -p tcp -s SOURCE_IP --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds 3600 --hitcount 5 -j DROP

    This limits WWW connections from SOURCE_IP to 4 connections per hour (3600 seconds), the 5th one will be silently dropped.
    Pings <1 ms, Unlimited Transfer, Lowest Price: http://localhost/

  3. #3
    Thanks! I don't have that kind of access on my web host unfortunately. I will have to come up with an apache mod or some sort of installable solution I can convince them to install for me.

Posting Permissions

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