From: Alexei Ustyuzhaninov <alust@alust.homeunix.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: pthyseba@intec.ugent.be, netfilter@vger.kernel.org
Subject: Re: fwmark iptables/ip routing interaction question
Date: Sun, 11 May 2008 22:23:39 +0600 [thread overview]
Message-ID: <48271D8B.5030608@alust.homeunix.com> (raw)
In-Reply-To: <alpine.LNX.1.10.0805071703150.30395@fbirervta.pbzchgretzou.qr>
Jan Engelhardt wrote:
> On Wednesday 2008-05-07 16:36, pthyseba@intec.ugent.be wrote:
>> This setup works as expected: the targeted packets are routed to the
>> different gateway. However, my question is: why does this work?
>
> Because we expect it to :)
>
>> After studying the iptables block diagrams, it seems that the packet
>> travels through the OUTPUT chains AFTER "routing". I assumed that
>> "routing" implied the lookup of the correct routing table and then
>> selection of the correct rule in that table, but putting the iptables and
>> my definition of "routing" together, it would seem that packets only get
>> marked (the MARK target is in the output chain) after "routing" has been
>> done (and I assumed filtering packets using the fwmark filter was done in
>> that step). Obviously, I'm misunderstanding something, as packets that get
>> marked in the OUTPUT chain do get routed correctly (meaning, have their
>> mark set when routing is looking for the correct routing table).
>
> Correct, there is an extra reroute done in the output path
> (see http://jengelh.medozas.de/images/nf-packet-flow.png )
Jan, could you explain please which code does this extra rerouting:
iproute2 or netfilter? I have a weird with the same scenario: after
rerouting a packet goes out through another interface but keeps the
source address of the original interface.
--
Alexei
next prev parent reply other threads:[~2008-05-11 16:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-07 14:36 fwmark iptables/ip routing interaction question pthyseba
2008-05-07 15:04 ` Jan Engelhardt
2008-05-11 16:23 ` Alexei Ustyuzhaninov [this message]
2008-05-11 17:39 ` Jan Engelhardt
2008-05-11 17:50 ` Alexei Ustyuzhaninov
2008-05-16 15:03 ` Pascal Hambourg
2008-05-17 3:53 ` Alexei Ustyuzhaninov
2008-05-17 10:49 ` Pascal Hambourg
2008-05-17 12:37 ` Alexei Ustyuzhaninov
2008-05-17 23:26 ` Pascal Hambourg
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=48271D8B.5030608@alust.homeunix.com \
--to=alust@alust.homeunix.com \
--cc=jengelh@medozas.de \
--cc=netfilter@vger.kernel.org \
--cc=pthyseba@intec.ugent.be \
/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