Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Philip Craig <philipc@snapgear.com>
To: Tsuyoshi Takada <acroyear@gmx.ch>
Cc: netfilter@lists.netfilter.org
Subject: Re: iptables limit-burst trouble
Date: Tue, 10 Jun 2003 14:35:26 +1000	[thread overview]
Message-ID: <3EE5600E.8040201@snapgear.com> (raw)
In-Reply-To: <20030609111735.C484.ACROYEAR@gmx.ch>

Tsuyoshi Takada wrote:
> I want to limit Web DoS attack.
> 
> I have set the following but it does not work well.
> 
> iptables -N flood-chk
> iptables -A INPUT     -p tcp --dport 80 --syn -j flood-chk
> iptables -A flood-chk -m limit --limit 1/sec --limit-burst 2 -j RETURN
> iptables -A flood-chk -j LOG --log-prefix "IPTABLES HTTP FLOOD-PACKET"
> iptables -A flood-chk -j DROP
> 
> After I accessed to my web site,
> I pushed reload button of my web browser repeatedly but 
> I was not denied by iptables.
> Why?

These rules work for me.  Note however that if you hit the limit,
your browser will automatically retransmit and succeed if it is at
least 1 second later.  You should notice a delay in loading the
page when the browser has to retransmit.  You should also get the
syslog message.

If you change the DROP to a REJECT, then your browser will display
'connection refused' when it reaches the limit, rather than
retransmitting.  (Using REJECT isn't good for protection against
a DoS attack though, just do this for testing that the rules
are working.)

I would also recommend putting a limit on the rule for the LOG
message, otherwise it is possible to flood your logs.

-- 
Philip Craig - philipc@snapgear.com - http://www.SnapGear.com
SnapGear - Custom Embedded Solutions and Security Appliances



  parent reply	other threads:[~2003-06-10  4:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-09  2:22 iptables limit-burst trouble Tsuyoshi Takada
2003-06-10  3:04 ` Tsuyoshi Takada
2003-06-10  4:35 ` Philip Craig [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-06-10  3:25 George Vieira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EE5600E.8040201@snapgear.com \
    --to=philipc@snapgear.com \
    --cc=acroyear@gmx.ch \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox