NetFilter
[Top] [All Lists]

Re: Shouldn't this rule catch all packets

To: NetFilter <netfilter@lists.netfilter.org>
Subject: Re: Shouldn't this rule catch all packets
From: jwlargent <jwlargent@vlsmaps.com>
Date: Thu, 14 Dec 2006 15:46:33 -0600
Delivered-to: sp-com-lists@consult.net
Delivered-to: netfilter-list1@securepoint.com
In-reply-to: <slrneo3b2o.8uu.xpisar@album.ics.muni.cz>
List-archive: </pipermail/netfilter>
List-help: <mailto:netfilter-request@lists.netfilter.org?subject=help>
List-id: General discussion and user questions <netfilter.lists.netfilter.org>
List-post: <mailto:netfilter@lists.netfilter.org>
List-subscribe: <https://lists.netfilter.org/mailman/listinfo/netfilter>, <mailto:netfilter-request@lists.netfilter.org?subject=subscribe>
List-unsubscribe: <https://lists.netfilter.org/mailman/listinfo/netfilter>, <mailto:netfilter-request@lists.netfilter.org?subject=unsubscribe>
References: <4581A2F1.10305@vlsmaps.com> <slrneo3b2o.8uu.xpisar@album.ics.muni.cz>
Sender: netfilter-bounces@lists.netfilter.org
User-agent: Thunderbird 1.5.0.8 (X11/20061025)
Petr Pisar wrote:
On 2006-12-14, jwlargent <jwlargent@vlsmaps.com> wrote:
I was trying to debug some errors in my iptables setup so I added the following rules to my OUTPUT, just to see what packets were going out.

iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -j ACCEPT

When I do iptables -L OUTPUT -v it shows some packets are falling through to the last rule.
Shouldn't the first rule catch all the packets?

No. There exists forth state called INVALID. E.g. TCP packet with ACK
witch is not part of any tracked TCP connection is INVALID. Naturally,
INVALID packets are ill packets and they shoudn't appear, but the reality
is different.

-- Petr

So I put in a log rule for --state INVALID and sure enough thats what it was.
The packets are part of my ssh connection, tcp with ACK.

IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=276 TOS=0x10 PREC=0x00 TTL=64 ID=1146 DF PROTO=TCP SPT=22 DPT=38858 WINDOW=3228 RES=0x00 ACK PSH URGP=0



<Prev in Thread] Current Thread [Next in Thread>