All of lore.kernel.org
 help / color / mirror / Atom feed
* policy routing on locally generated packets
@ 2003-08-25 12:09 lartc
  2003-08-25 12:31 ` Patrick McHardy
  0 siblings, 1 reply; 20+ messages in thread
From: lartc @ 2003-08-25 12:09 UTC (permalink / raw)
  To: netfilter-devel

Hello Gentle Developers,

May I first start by extending my sincerest gratitude to all that have
particpated in the netfilter project -- needless to say that it has been
of infinite value to me and many, many users. Thanks, thanks, thanks.


So, there has been some traffic over a period of time on the lartc list
concerning application based routing, which translates more specifically
to the issue of how to do policy based routing of locally generated
packets given that the "routing decision" has been made prior to a
packet traversing the OUTPUT chain.
	
Take for example the following script:

#!/bin/bash
iptables --append OUTPUT --table mangle --match owner \
     --gid-owner 500 --jump MARK --set-mark 0x2

iptables --append OUTPUT --table mangle --match owner \
     --gid-owner 501 --jump MARK --set-mark 0x3

ip rule add fwmark 0x2 table 2
ip route add default dev eth0 src 192.168.0.1 via 192.168.0.254 table 2
ip rule add fwmark 0x3 table 3
ip route add default dev eth0 src 192.168.0.2 via 192.168.0.253 table 3
ip route flush cache
#end_script


This is a sample of source ip routing policy, but one could imagine
routing based on tos, etc. Regrettably, this example will not work as
the default routing table is consulted prior to the marking.

While I'm not a programmer but have dreamt up a new target for the
POSTROUTING chain NAT table:

iptables --append POSTROUTING --table nat --jump rt_lookup


The statement would force a new routing decision to be made using the
properties of the packet as it traverses the nat table, respecting any
marking, tos, etc.

Could any of you be kind enough to offer an analysis of such a new
target, i.e. would it work, would it be terribly complex, ...


Sincerely Yours,

Charles Shick

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

end of thread, other threads:[~2003-08-27 16:19 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-25 12:09 policy routing on locally generated packets lartc
2003-08-25 12:31 ` Patrick McHardy
2003-08-25 15:13   ` Patrick McHardy
2003-08-25 18:53     ` lartc
2003-08-25 19:07       ` Patrick Schaaf
2003-08-26  8:47         ` lartc
2003-08-26 11:09           ` Patrick Schaaf
2003-08-26 12:01             ` lartc
2003-08-26 12:14               ` Cedric de Launois
2003-08-26 18:47                 ` lartc
2003-08-26 19:40             ` Henrik Nordstrom
2003-08-26 13:17           ` Patrick McHardy
2003-08-26 19:37           ` Henrik Nordstrom
2003-08-26 13:12         ` Patrick McHardy
2003-08-26 19:45           ` Henrik Nordstrom
2003-08-27 14:46             ` policy routing on locally generated packets [summary] lartc
2003-08-27 14:57               ` Patrick McHardy
2003-08-27 16:19                 ` lartc
2003-08-27 14:58               ` Henrik Nordstrom
2003-08-26 13:06       ` policy routing on locally generated packets Patrick McHardy

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.