From: Georgi Georgiev <chutz@gg3.net>
To: netfilter@vger.kernel.org
Subject: PPPoE on a bridge, nat sees bridge as incoming interface
Date: Fri, 7 Mar 2008 02:22:18 +0900 [thread overview]
Message-ID: <20080306172218.GA14566@possum.gg3.net> (raw)
Hi all,
I am having trouble understaning how bridging and iptables fit together.
The situation that bugs me is: if I do a PPPoE connection over a bridge
with a single physical port, my nat table will see any incoming packet
as coming from the bridge interface, and not the ppp interface. Why?
The issue I have is similar to what this poster
http://marc.info/?l=netfilter&m=120451146916327 but there were no
responses. If it's something basic, please at least give tell me what
keywords to use as I am having trouble finding anything.
The setup to reproduce this is simple:
modem <-> eth0 <-> pppd (ppp0)
All chains have a single -j LOG rule.
Kernel is 2.6.24.3 with no patches.
I ping myself from a remote host and I get this:
t=mangle c=PREROUTING IN=ppp0 OUT= MAC= SRC=<remote_IP> DST=<local_IP>
t=nat c=PREROUTING IN=ppp0 OUT= MAC= SRC=<remote_IP> DST=<local_IP>
t=mangle c=INPUT IN=ppp0 OUT= MAC= SRC=<remote_IP> DST=<local_IP>
t=filter c=INPUT IN=ppp0 OUT= MAC= SRC=<remote_IP> DST=<local_IP>
t=mangle c=OUTPUT IN= OUT=ppp0 SRC=<local_IP> DST=<remote_IP>
t=filter c=OUTPUT IN= OUT=ppp0 SRC=<local_IP> DST=<remote_IP>
t=mangle c=POSTROUTING IN= OUT=ppp0 SRC=<local_IP> DST=<remote_IP>
nat sees the ping as coming from ppp0. Good.
Now, I add a bridge and connect eth0 to it.
# brctl add br0
# brctl addif br0 eth0
I connect with pppd in the same way as before (through eth0), ping myself, and
I get what looks like identical output. (Skipping the output)
Now I connect again, but this time pppd uses br0 to get to the internet
and the output becomes:
t=mangle c=PREROUTING IN=br0 OUT= PHYSIN=eth0 MAC=<eth0_mac>:<router_mac>:88:64 SRC=<remote_IP> DST=<local_IP>
t=nat c=PREROUTING IN=br0 OUT= PHYSIN=eth0 MAC=<eth0_mac>:<router_mac>:88:64 SRC=<remote_IP> DST=<local_IP>
t=mangle c=INPUT IN=ppp0 OUT= PHYSIN=eth0 MAC= SRC=<remote_IP> DST=<local_IP>
t=filter c=INPUT IN=ppp0 OUT= PHYSIN=eth0 MAC= SRC=<remote_IP> DST=<local_IP>
t=mangle c=OUTPUT IN= OUT=ppp0 SRC=<local_IP> DST=<remote_IP>
t=filter c=OUTPUT IN= OUT=ppp0 SRC=<local_IP> DST=<remote_IP>
t=mangle c=POSTROUTING IN= OUT=ppp0 SRC=<local_IP> DST=<remote_IP>
As you can see, the nat table sees the incoming packet as coming from
the bridge itself and from the ppp interface. Why is that?
The implication of this is that I cannot choose my DNAT rules based on
the incoming (ppp) interface (which I can easily do if I don't connect
pppd to a bridge).
--
() Georgi Georgiev () I am having FUN... I wonder if it's NET ()
() chutz@gg3.net () FUN or GROSS FUN? ()
() http://www.gg3.net/ () ()
next reply other threads:[~2008-03-06 17:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 17:22 Georgi Georgiev [this message]
2008-03-06 22:01 ` PPPoE on a bridge, nat sees bridge as incoming interface Grant Taylor
2008-03-06 22:05 ` Jan Engelhardt
2008-03-07 0:49 ` Georgi Georgiev
2008-03-07 1:13 ` Pascal Hambourg
2008-03-07 5:16 ` Grant Taylor
2008-03-11 11:08 ` [SOLVED] " Georgi Georgiev
2008-03-11 12:05 ` Jan Engelhardt
2008-03-11 14:32 ` Pascal Hambourg
2008-03-11 15:49 ` Jan Engelhardt
2008-03-06 22:36 ` Pascal Hambourg
2008-03-07 0:43 ` Georgi Georgiev
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=20080306172218.GA14566@possum.gg3.net \
--to=chutz@gg3.net \
--cc=netfilter@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox