All of lore.kernel.org
 help / color / mirror / Atom feed
* Synflood filtering and Conntrack
@ 2010-07-27 22:29 Dennis J.
  2010-07-28  5:24 ` Mart Frauenlob
  0 siblings, 1 reply; 18+ messages in thread
From: Dennis J. @ 2010-07-27 22:29 UTC (permalink / raw)
  To: netfilter

Hi,
today I ran into a problem where several IPs where syn-flooding one of our 
webservers. The first issue was that the conntrack table was filled up on 
the firewall and I had to put a NOTRACK rule into the raw table to get that 
"fixed". Once we got a better picture of the situation we blocked the 
offending IPs and things wend back to normal on the web server.

My question is how do I handle this case in a more scalable fashion in the 
future. I found the following rules on the net and they seem to do what is 
needed (namely blocking IPs that create an excessive number of syn 
connections):

iptables -A INPUT -m state --state NEW -p tcp -m tcp --syn \
     -m recent --name synflood --set
iptables -A INPUT -m state --state NEW -p tcp -m tcp --syn \
     -m recent --name synflood --update --seconds 1 --hitcount 30 -j DROP

What I'm wondering about is the "--state NEW" part. If I re-enable 
connection tracking again for the above rules to work wouldn't these fill 
up again and basically make these rules useless? Or can I essentially 
remove the state module bits and just use the plain packets for this since 
the syn flag is only used in establishing a new connection anyway which 
makes the "--state NEW" bit not necessary?

Regards,
   Dennis

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

end of thread, other threads:[~2010-07-30 10:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 22:29 Synflood filtering and Conntrack Dennis J.
2010-07-28  5:24 ` Mart Frauenlob
2010-07-28  6:11   ` Jan Engelhardt
2010-07-28 13:30     ` Pascal Hambourg
2010-07-28 14:10       ` Jan Engelhardt
2010-07-28 14:27         ` Pascal Hambourg
2010-07-29 11:11     ` Mart Frauenlob
2010-07-29 11:21       ` Jan Engelhardt
2010-07-29 11:31         ` Mart Frauenlob
2010-07-29 12:34           ` Pascal Hambourg
2010-07-29 12:49             ` Jan Engelhardt
2010-07-29 13:16               ` Pascal Hambourg
2010-07-29 15:50               ` Jozsef Kadlecsik
2010-07-29 17:14                 ` Gáspár Lajos
2010-07-29 17:52                   ` Jozsef Kadlecsik
2010-07-29 22:18                 ` Mart Frauenlob
2010-07-29 23:19                 ` Pascal Hambourg
2010-07-30 10:32                   ` Jozsef Kadlecsik

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.