Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Ruslan Kazansky" <rsllst2@kursknet.ru>
To: netfilter@lists.netfilter.org
Subject: iptables -m state & New !SYN (conntrack problem)
Date: Wed, 23 Oct 2002 12:30:15 +0400	[thread overview]
Message-ID: <00d901c27a6e$69db5bd0$fe01a8c0@upr> (raw)

Hi!

I am use linux, kernel 2.4.18, frontend - iptables v1.2.6a.

1)

iptables consist the following rules:

====begin============
iptables -t filter -A bad_pkt -p TCP -m state --state ! NEW -j ACCEPT

iptables -t filter -A bad_pkt -p TCP -m state --state NEW --tcp-flags
SYN,ACK,FIN,RST SYN -j ACCEPT

iptables -t filter -A bad_pkt -p TCP -j LOG --log-prefix "New !SYN: "

====end============

In log i see packets, which conntrack is mark "NEW", but it flags is
equivalent to:

--tcp-flags SYN,ACK,FIN,RST ACK,FIN

--tcp-flags SYN,ACK,FIN,RST ACK

--tcp-flags SYN,ACK,FIN,RST ACK,RST

The ports number say, that is not portscan, it's normal connection packets.

Also, view "netstat -neoA inet" is not eqiv "cat /proc/net/ip_conntrack".

I.e ip_conntrack state is not corresponding REAL TCP-state !!!

Is that normal or kernel (ipfilter) bug ???

2)

/proc/net/ip_conntrack consist very long (till 5 days) hanging record, AFAIR
corresponded:

(linux/net/ipv4/netfilter/ip_conntrack_proto_tcp.c):

      5 DAYS,     /*      TCP_CONNTRACK_ESTABLISHED,      */

Some people recommended decrease TCP_CONNTRACK_ESTABLISHED to 2 hour.

However, in kernel source (2.4.19, patch-2.4.20-pre11) maintainers is not
confirm this correction, why... ???

What is the way against possible DOS-attack to ip_conntrack, where, IMHO,
to:

  ip_conntrack: maximum limit of XXX entries exceeded ?

Also, view "netstat -neoA inet" is not consist "hanging" connection, it show
only in

/proc/net/ip_conntrack...

3)

Why timeout for ip_conntrack in

linux/net/ipv4/netfilter/ip_conntrack_proto_tcp.c

is different from TCP-timeout ?

Or it's only for UDP & ICMP protocols ?

______________________________
Ruslan Kazansky,
Network Administrator,
ISP Joint Stock Company
"Electrosvyaz - Kursk Region",
Kursk, Russia, http://www.kursknet.ru






                 reply	other threads:[~2002-10-23  8:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='00d901c27a6e$69db5bd0$fe01a8c0@upr' \
    --to=rsllst2@kursknet.ru \
    --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