All of lore.kernel.org
 help / color / mirror / Atom feed
* conn limit question (limit module or similar)
@ 2003-11-13 15:11 Federico Petronio
  0 siblings, 0 replies; only message in thread
From: Federico Petronio @ 2003-11-13 15:11 UTC (permalink / raw)
  To: netfilter

Hello all...

I use for some time a module called 'limit' to limit the amount of 
connections per timeunit to my SMTP server.  But the limitations I found 
is that you need to write a rule that matches to apply the filter:

-A INPUT -s 0/0 -d 0/0 -m limit --limit 60/minute --limit-burst 45 -m 
tcp -p tcp --dport 25 --syn -j SMTPCHAINS

I mean... it is not possible to define something like:

"do no accept more than 60 connections per minute for ANY IP, and, if 
that limit is reach for some IP, do not limit the rest of connections"

since you can not write a rule for all the possible IPs. I found a (not 
so good) solution to this... I divided the IPs range in 8 groups:

-A SMTPCHAINS -s 0.0.0.0/0.0.0.7 -d 0/0 -m limit --limit 45/minute 
--limit-burst 20 -m tcp -p tcp --dport 25 --syn -j ACCEPT
-A SMTPCHAINS -s 0.0.0.1/0.0.0.7 -d 0/0 -m limit --limit 45/minute 
--limit-burst 20 -m tcp -p tcp --dport 25 --syn -j ACCEPT
-A SMTPCHAINS -s 0.0.0.2/0.0.0.7 -d 0/0 -m limit --limit 45/minute 
--limit-burst 20 -m tcp -p tcp --dport 25 --syn -j ACCEPT
-A SMTPCHAINS -s 0.0.0.3/0.0.0.7 -d 0/0 -m limit --limit 45/minute 
--limit-burst 20 -m tcp -p tcp --dport 25 --syn -j ACCEPT
-A SMTPCHAINS -s 0.0.0.4/0.0.0.7 -d 0/0 -m limit --limit 45/minute 
--limit-burst 20 -m tcp -p tcp --dport 25 --syn -j ACCEPT
-A SMTPCHAINS -s 0.0.0.5/0.0.0.7 -d 0/0 -m limit --limit 45/minute 
--limit-burst 20 -m tcp -p tcp --dport 25 --syn -j ACCEPT
-A SMTPCHAINS -s 0.0.0.6/0.0.0.7 -d 0/0 -m limit --limit 45/minute 
--limit-burst 20 -m tcp -p tcp --dport 25 --syn -j ACCEPT
-A SMTPCHAINS -s 0.0.0.7/0.0.0.7 -d 0/0 -m limit --limit 45/minute 
--limit-burst 20 -m tcp -p tcp --dport 25 --syn -j ACCEPT

but I stell want something better. I guess that using some kind of 
connection trucking to know the histoty of connections from each IP 
could be the solution.

The question is... Is there any module o reluset that achive that?

Thank you very much....
-- 

                                        Federico Petronio
                                        petronio@agro.uba.ar
                                        Linux User #129974

---
There are only 10 types of people in the world:
              Those who understand binary and those who don't.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-13 15:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-13 15:11 conn limit question (limit module or similar) Federico Petronio

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.