All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: netfilter@lists.netfilter.org
Cc: Petr Pisar <petr.pisar@atlas.cz>
Subject: Re: Not NATed packets
Date: Fri, 05 May 2006 00:22:00 +0200	[thread overview]
Message-ID: <445A7E88.406@plouf.fr.eu.org> (raw)
In-Reply-To: <e30e0b$284$1@sea.gmane.org>

Petr Pisar a écrit :
> 
> and after doing this excercise I can't see any change on counters in 
> POSTROUTING chain. Naturaly I can't see anything in the kernel log (as 
> you can see, I log everything before MASQ and after that).
> 
> I seems, these magic packets are completly bypassing POSTROUTING chain.
> 
> I found out too that TCP traffic goes inside this chain only with first 
> SYN packet. After that there the packets are I don't see them anymore. 
> Is it normal?
> 
> So, I have one workaround. These magic packets are INVALID from point of 
> state module's view.

Connection tracking state is the key to explain all that you observed.
Only NEW packets can create an entry in the connection tracking table 
(which contents can been seen through /proc/net/ip_conntrack) and can go 
through the 'nat' chains. That's why :
- INVALID packets bypass the nat chains, thus aren't NATed nor counted
- only the first NEW packet of a connection, which is usually a SYN in 
TCP connections, goes through the nat chains. Duplicate SYN, although 
NEW too, or subsequent packets belonging (ESTABLISHED) or related 
(RELATED) to the same connection in either direction don't. However all 
get automatically NATed according to the conntrack entry in a way 
determined by how the first packet was NATed.

> 
> I'm not sure if any INVALID packet can also be considered as a health 
> packet. Can you see any false positivities?

Unlike malformed packets which the experimental "unclean" match tries to 
detect, INVALID packets are not "unhealthy" in nature, they're just 
unexpected. And yes, false positive can occur. With kernels older than 
2.4.29, some locally-generated ICMP replies are wrongly considered 
INVALID instead of RELATED.


  reply	other threads:[~2006-05-04 22:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-23 15:04 Not NATed packets lukas
2006-04-23 20:35 ` Petr Pisar
2006-04-24  9:55   ` lukas
2006-05-04 20:35     ` Pascal Hambourg
2006-04-29 18:44   ` Petr Pisar
2006-04-29 19:15 ` Petr Pisar
2006-05-04 22:22   ` Pascal Hambourg [this message]
2006-05-05 17:26     ` Petr Pisar

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=445A7E88.406@plouf.fr.eu.org \
    --to=pascal.mail@plouf.fr.eu.org \
    --cc=netfilter@lists.netfilter.org \
    --cc=petr.pisar@atlas.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.