Linux Netfilter discussions
 help / color / mirror / Atom feed
* Routing locally generated traffic on fwmark
@ 2011-09-28 22:20 Andrew Beverley
  2011-09-29  6:51 ` Andrew Beverley
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Beverley @ 2011-09-28 22:20 UTC (permalink / raw)
  To: netfilter

Hi,

I'd like to route locally generated traffic via a particular interface
based on its mark value.

From what I have researched, this is theoretically possible and lots of
people have tried it, but nobody has got it working.

Here's my rules:

# Mark the packets
iptables -A OUTPUT -t mangle -d 89.16.176.81 -j MARK --set-mark 0x800

# Route the marked packets via routing table T2:
ip rule add fwmark 0x800/0xffff table T2

# Force T2 packets out of the interface ppp1
ip route add table T2 default dev ppp1 via 94.30.127.76

# Flush the cache, just in case
ip route flush cache

However, the packets still go out of the default route (ppp0).

cwdwr:~# ip rule
0:	from all lookup local 
32765:	from all fwmark 0x800/0xffff lookup T2 
32766:	from all lookup main 
32767:	from all lookup default 

cwdwr:~# ip route show table T2
default via 94.30.127.76 dev ppp1 

Any ideas? Should this be possible?

Thanks,

Andy



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

end of thread, other threads:[~2011-10-02 13:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-28 22:20 Routing locally generated traffic on fwmark Andrew Beverley
2011-09-29  6:51 ` Andrew Beverley
2011-09-29  7:32   ` Pandu Poluan
2011-09-29  7:53     ` [SOLVED] " Andrew Beverley
2011-09-29  8:29       ` Pandu Poluan
2011-10-02 13:11         ` Ed W
2011-09-29 10:28   ` Jan Engelhardt
2011-09-29 17:28     ` Andrew Beverley
2011-09-29 17:35       ` Jan Engelhardt
2011-09-29 17:46         ` Andrew Beverley

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