2

How I can restrict the number of http and https connections from a specified IP address to ten per minute usingiptables commands?

I’ve tried this but it is not working:

iptables -A INPUT -s 192.168.1.100 -p tcp -m multiport --destination-port 80,443 -m state --state NEW -m limit --limit 10/min -j ACCEPT

and somebody tells me that you must use recent module!

What about this way?

iptables -A INPUT -p tcp --syn --match multiports --dport http,https -m state --state NEW -m recent --set --name HTTP

iptables -A INPUT -m recent --update --seconds 60 --hitcount 11 --name HTTP -j ACCEPT

still not working.

1 Answer 1

-1

You can use the following iptables command:

iptables –A INPUT –s $IP_Address –p tcp –m multiport –-destination-port 80,443 –m state --state NEW –m limit -–limit 10/min –j ACCEPT

Network Security Course?...

4
  • 1
    What am I missing? As far as I can tell, aside from the cosmetic substitution of $IP_Address for the actual IP address, your answer is the same as the first command given in the question –– where the OP states that it doesn’t work. Commented Mar 12, 2013 at 20:52
  • I've finally find where is the problem!!i forget to append DROP in the end of the list :)
    – Arash
    Commented Mar 13, 2013 at 4:11
  • @arashams: If you have found an answer, then post it as an answer and accept it. Commented Mar 13, 2013 at 21:54
  • append DROP in the end of the list
    – Arash
    Commented Mar 26, 2013 at 7:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .