All of lore.kernel.org
 help / color / mirror / Atom feed
* noob question howto using iptables limit ip access times
@ 2010-06-21 11:30 Zhu Jing
  2010-06-21 11:53 ` /dev/rob0
  2010-06-21 12:02 ` Pascal Hambourg
  0 siblings, 2 replies; 5+ messages in thread
From: Zhu Jing @ 2010-06-21 11:30 UTC (permalink / raw)
  To: netfilter

hi ,all

 My aim is limit ip access to my squid server with 1000 times per day.
If this ip connections counts more then 1000,iptables will drop it.

 I have google a lot,and write a wired scripts :P

===========
    #!/bin/sh
   iptables -F
   iptables -X
   iptables -Z
   iptables -N squid
   iptables -A INPUT -p tcp --dport 80 -j squid
   iptables -A squid -m limit --limit 1/hour --limit-burst 1000 -j RETURN
   iptables -A squid -j DROP
   service iptables save
  service iptables restart
==========

   iptables -A squid -m limit --limit 1/hour --limit-burst 1000 -j RETURN

   IMO: this rule means ,the limit-burst token bucket is set to 1000
initially, for each hour token count goes up by 1, when token bucket
is empty---> not match --> go next rule
   But,  I tested it by using IE refresh my server , when i refresh
more then 7 or 8 times ,iptables going to drop my connections, why?

  CentOS4.6,kernel 2.6.9,iptables v1.3.5
  Im so sorry for my bad English,hope your understand what i was saying
  Any reply, webslink, experience ,doc and tools  are highly appreciable!!



  Regards

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-22  4:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-21 11:30 noob question howto using iptables limit ip access times Zhu Jing
2010-06-21 11:53 ` /dev/rob0
2010-06-21 12:02 ` Pascal Hambourg
2010-06-21 14:58   ` Curby
2010-06-22  4:38     ` Zhu Jing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.