Linux Netfilter discussions
 help / color / mirror / Atom feed
* fwmark iptables/ip routing interaction question
@ 2008-05-07 14:36 pthyseba
  2008-05-07 15:04 ` Jan Engelhardt
  0 siblings, 1 reply; 10+ messages in thread
From: pthyseba @ 2008-05-07 14:36 UTC (permalink / raw)
  To: netfilter


Hello,

After reading docs on iptables and advanced linux routing using iproute2,
I'm left with the following question:

I have succesfully setup a routing policy on Red Hat Enterprise Linux 4
where one type of locally generated traffic is routed to a gateway
different from the default gateway. I have done this straight from the
book:

add a MARK target for these packets in the OUTPUT chain of table "mangle"
add a routing rule for marked packets to a different routing table
add a default gateway to the new routing table.


This setup works as expected: the targeted packets are routed to the
different gateway. However, my question is: why does this work?

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).

What's wrong in my understanding of the interaction between iptables and
"routing" ?

Thanks,
Pieter

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-05-17 23:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox