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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pascal a wrote:
> Petr Pisar a écrit :
>>
> 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.

Thanks for hint. I skipped notice in iptables man page about nat filter
and NEW packets, that explains this behaviour.

>>
>> 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.

Yes, of course (e.g. valid FIN packet looses somewhere after NAT, client
retransmits it and iptables will consider this second FIN as INVALID. Or
does nefilter remeber for this sitation?).

Maybe I should explain whole scenario to you:

I have a provider which connection is terminated with PPP device on my
router. I have assigned only one public dynamic IP. Therefore I
masquerade all packet originating in my local network. The problem is
when packet with source IP different from now assigned public address is
sent from ppp0 device to the provider, the provider will terminate the
PPP connection.

If I have one invalid packet, then it will not be SNATed, provider close
connection, ppp0 link will be going down, iptables flush conntrack
table, pppd redial provider, I get new IP, all applications in local
network retransmitte TCP packets, netfiler on router recognise them as
INVALID, it will not NATed them, provider close conncetion again and so
on. The pppd deamon begin throthling and connection become unusable.

Therefore I need be sure, all packets leaving ppp0 device have right
public IP.

- --Petr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEW4qruR4f4nEwzHIRAugmAKCSQ6jKEXkrEPDcMQWFxS3H1Lvt5wCfRoZc
asBbX5Bird0l/wfD7ipJbAc=
=mcrc
-----END PGP SIGNATURE-----



      reply	other threads:[~2006-05-05 17:26 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
2006-05-05 17:26     ` Petr Pisar [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='e3g1re$etf$1@sea.gmane.org' \
    --to=petr.pisar@atlas.cz \
    --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 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.