All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yavetskiy Yuriy <yavetskiy@kpi.ua>
To: netfilter@vger.kernel.org
Subject: DNAT and 802.1q tagged bridge
Date: Thu, 11 Feb 2010 22:11:05 +0200	[thread overview]
Message-ID: <4B746459.9070709@kpi.ua> (raw)

I have a bridge of two physical interfaces: eth1, eth2. Vlan tagged 
packets go through this bridge, but bridge itself doesn't know about 
vlan numbers (there're a lot of vlans,they change frequently, it's 
impossible to set them on a bridge) and bridge has no ip address.
ebtables and conntrack are  both loaded.
DROP and ACCEPT run on this bridge.
Under certain destination ip and port, I need to DNAT packets to 
loopback, I add 10.0.0.1 to loopback, as DNAT often doesn't work on 127/8.
Here's an example rule which somehow does not work:
iptables-t nat-A PREROUTING-m physdev - physdev-in eth1-d 1.1.1.1-j DNAT 
- to-destination 10.0.0.1
iptables-t nat-A POSTROUTING-s 10.0.0.1-j SNAT - to-source 1.1.1.1
Packages come on eth1. Return (after Snat) packets must go through eth0, 
the interface is untagged, the gateway lives behind it.
I make a telnet from the world, in iptables DNaT counter is incremented 
by 1, but telnet does not respond, syn + ack in response does not come, 
and counters of SNAT are zeroed. Telnet passes from bridge machine, the 
problem is exactly in DNAT. This scheme also doesn't work without SNAT.
Maybe the problem is that packets Tagged? But netfilter is not looking 
at the package ethernet headers during DNaT, it looks only on IP packet 
headers, as DNaT, for example, can be done in Gre-tunnel, which is not 
ethernet device. Maybe reason in no ipv4 routes on bridge interface (but 
interface is tagged, I don't know vlan numbers and there are no untagged 
packets running throu bridge so I can't simply add route on bridge device).


-- 
WBR
Yavetskiy Yuriy
ULTI-RIPE


                 reply	other threads:[~2010-02-11 20:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4B746459.9070709@kpi.ua \
    --to=yavetskiy@kpi.ua \
    --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 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.