Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Bernd Strebel <b.strebel@digitec.de>
To: netfilter@lists.netfilter.org
Cc: Stephane Bortzmeyer <bortzmeyer@nic.fr>
Subject: Re: strange behavior of connlimit matching rules
Date: Wed, 19 May 2004 12:18:40 +0200	[thread overview]
Message-ID: <40AB3480.6030405@digitec.de> (raw)
In-Reply-To: <20040518074343.GA5990@nic.fr>

Thanks for your reply. I've re-arranged the rules to something like

-P DROP

--state RELATED,ESTABLISHED -j ACCEPT
--connlimit-above n -j LOG
--state NEW --syn ! --connlimit-above n -j ACCEPT
--state NEW --syn ... -j ACCEPT
... many ... -j ACCEPT

... many ... -j LOG to log packages which aren't accepted

and now it is working.

But, with this solution every SYN packet first has to be checked against 
the connlimit rule before entering the ACCEPT block. I would prefer to 
do the logging of unwanted packages after all accepting rules and this 
works fine with all the other matching modules (e.g. time, owner).

And,  I am still worried about the fact, that a package no longer 
matches against a connlimit rule after it was checked against a 
!connlimit rule ...

Stephane Bortzmeyer wrote:
> On Tue, May 18, 2004 at 09:00:52AM +0200,
>  Bernd Strebel <b.strebel@digitec.de> wrote 
>  a message of 63 lines which said:
> 
> 
>>Along with the implementation of a simple rule set ( ACCEPT connections 
>>if ! --connlimit-above n and LOG connections if --connlimit-above n) we 
>>experienced a strange behavior of the connlimit matching module:
>>
>>Rule #m:   ...-m connlimit   --connlimit-above n -j LOG
>>Rule #m+1: ...-m connlimit ! --connlimit-above n -j ACCEPT
>>
>>works fine, while
>>
>>Rule #m:   ...-m connlimit ! --connlimit-above n -j ACCEPT
>>Rule #m+1: ...-m connlimit   --connlimit-above n -j LOG
>>
>>works not (no match on rule #m+1).
> 
> 
> No idea but what I do (and it works) is:
> 
> Rule #m:   ...-m connlimit   --connlimit-above n -j LOG
> Rule #m+1: ...-m connlimit   --connlimit-above n -j REJECT
> ... Other rules, which may accept
> 
> 



      parent reply	other threads:[~2004-05-19 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-18  7:00 strange behavior of connlimit matching rules Bernd Strebel
     [not found] ` <20040518074343.GA5990@nic.fr>
2004-05-19 10:18   ` Bernd Strebel [this message]

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=40AB3480.6030405@digitec.de \
    --to=b.strebel@digitec.de \
    --cc=bortzmeyer@nic.fr \
    --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