Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote -1 down vote accepted

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?...

share|improve this answer
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. –  Scott Mar 12 '13 at 20:52
    
I've finally find where is the problem!!i forget to append DROP in the end of the list :) –  Christopher Mar 13 '13 at 4:11
    
@arashams: If you have found an answer, then post it as an answer and accept it. –  Scott Mar 13 '13 at 21:54
    
append DROP in the end of the list –  Christopher Mar 26 '13 at 7:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.