From: Florian Westphal <fw@strlen.de>
To: Daniel Collins <daniel.collins@smoothwall.net>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: Possible bug when bridging traffic we just SNATed and sent to another router
Date: Fri, 5 Jun 2015 17:08:27 +0200 [thread overview]
Message-ID: <20150605150827.GJ11015@breakpoint.cc> (raw)
In-Reply-To: <CAOmdcgVx6=3imz09QNW0eKU8Go=wZDHcWiKC8k2ki__af+rbAQ@mail.gmail.com>
Daniel Collins <daniel.collins@smoothwall.net> wrote:
please avoid top-posting, thanks.
> +----+ +----+
> | R1 | | R2 |
> +----+ +----+
> | |
> +-------------+
> | eth0 eth1 |
> | \ / |
> | \ / |
> | br0 |
> +-------------+
>
> So, the Linux box at the bottom attempts to route a packet from itself
> using R1, but R1 forwards the packet on to R2, at which point Linux
> creates a new conntrack and rewrites the port number as it passes over
> the bridge since that particular IP/port combination was already in
> use, by the first conntrack.
>
> Does that make it clearer?
So just to make sure:
#1 Linux send skb from (local_addr,daddr)
#2 r1 forwards packet to r2
#3 Linux receives its own packet again, with (saddr local_addr, daddr)
#4 Linux creates a new conntrack entry since lookup for old one would
expect (local_addr is daddr) reply
#5 new conntrack is created, with PAT applied to resolve port clash
collision
#6 remote_addr sends reply, to local_addr
#7 we lookup conntrack, find the one without PAT translation applied
#8 we possibly toss the packet since PAT undo doesn't (yet) yield
skb with a socket.
I'd recommend to fix this setup... If that can't be done, can you
suppress creation of 2nd conntrack entry?
It should be possible via "-t raw -s local_address -j CT --notrack".
next prev parent reply other threads:[~2015-06-05 15:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 14:14 Possible bug when bridging traffic we just SNATed and sent to another router Daniel Collins
2015-06-05 14:35 ` Florian Westphal
2015-06-05 14:49 ` Daniel Collins
2015-06-05 15:08 ` Florian Westphal [this message]
2015-06-05 15:27 ` Daniel Collins
2015-06-05 16:38 ` Florian Westphal
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=20150605150827.GJ11015@breakpoint.cc \
--to=fw@strlen.de \
--cc=daniel.collins@smoothwall.net \
--cc=netfilter-devel@vger.kernel.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.