From: Patrick McHardy <kaber@trash.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: netdev@vger.kernel.org,
Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] SNAT sometimes allows packets to pass through unchanged
Date: Wed, 18 Feb 2009 17:58:28 +0100 [thread overview]
Message-ID: <499C3E34.7080405@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0902181140120.17341-100000@iolanthe.rowland.org>
Alan Stern wrote:
> On Mon, 16 Feb 2009, Patrick McHardy wrote:
>
>> The NAT table only sees the first packet of every connection
>> and never INVALID packets. The mangle table should work fine.
>
> I ended up adding a rule to the FORWARD chain of the filter table.
> The trick was to select based on the state. That worked; it saw all
> those un-NATed packets and was able to eliminate them. In case you're
> curious, the rule was essentially this:
>
> iptables -A FORWARD -o eth1 -s 10.0.0.0/8 -m state --state INVALID -j DROP
>
> Ideally, the rule should select all the packets which haven't been
> altered by SNAT, not just the ones marked INVALID. Is there any way to
> do this?
Not in the sense that you could somehow catch valid packets "missed"
by SNAT, that would be a bug. The conntrack match supports matching
on whether the state says that a packet should be NATed.
next prev parent reply other threads:[~2009-02-18 16:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-11 17:37 [BUG] SNAT sometimes allows packets to pass through unchanged Alan Stern
2009-02-12 5:18 ` Patrick McHardy
2009-02-12 15:11 ` Alan Stern
2009-02-16 10:43 ` Patrick McHardy
2009-02-16 16:19 ` Alan Stern
2009-02-16 16:25 ` Patrick McHardy
2009-02-16 16:41 ` Alan Stern
2009-02-18 16:49 ` Alan Stern
2009-02-18 16:58 ` Patrick McHardy [this message]
2009-02-18 17:41 ` Alan Stern
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=499C3E34.7080405@trash.net \
--to=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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;
as well as URLs for NNTP newsgroup(s).