Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Bernd Strebel <b.strebel@digitec.de>
To: netfilter@lists.netfilter.org
Subject: strange behavior of connlimit matching rules
Date: Tue, 18 May 2004 09:00:52 +0200	[thread overview]
Message-ID: <40A9B4A4.2000201@digitec.de> (raw)

Along with the implementation of a simple rule set ( ACCEPT connections 
if ! --connlimit-above nan 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).

Many thanks for any explanation.
Bernd


environment: kernel 2.4.26, iptables 1.2.9, pomng-20040302
============

iptables output (source/dest. stripped, always 0.0.0.0/0)
===============

Chain OUTPUT (policy DROP 9 packets, 560 bytes): OK

num   pkts bytes target     prot opt in     out

1      131  9331 ACCEPT     all  --  *      lo

2      116 11140 ACCEPT     all  --  *      *
        state RELATED,ESTABLISHED

3        5   260 LOG        tcp  --  *      eth0
        mport dports 22 #conn/32 > 2 state NEW
        LOG flags 0 level 4 prefix CONNLIMIT

4        5   260 ACCEPT     tcp  --  *      eth0
        mport dports 22 #conn/32 < 2 state NEW

5        9   560 LOG        all  --  *      *
        LOG flags 0 level 4 prefix DROP-AT-END-OF-CHAIN


Chain OUTPUT (policy DROP 10 packets, 612 bytes): CONNLIMIT not logged!

num   pkts bytes target     prot opt in     out

1      138  9950 ACCEPT     all  --  *      lo

2      124 11648 ACCEPT     all  --  *      *
        state RELATED,ESTABLISHED

3        0     0 ACCEPT     tcp  --  *      eth0
        mport dports 22 #conn/32 < 2 state NEW

4        0     0 LOG        tcp  --  *      eth0
        mport dports 22 #conn/32 > 2 state NEW
        LOG flags 0 level 4 prefix CONNLIMIT

5       10   612 LOG        all  --  *      *
        LOG flags 0 level 4 prefix DROP-AT-END-OF-CHAIN



             reply	other threads:[~2004-05-18  7:00 UTC|newest]

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

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=40A9B4A4.2000201@digitec.de \
    --to=b.strebel@digitec.de \
    --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