Linux Netfilter discussions
 help / color / mirror / Atom feed
* Using MARK and TOS to route traffic through different interfaces to the same destination
@ 2008-12-11 12:18 Javier Gálvez Guerrero
  2008-12-11 12:33 ` Thomas Jacob
  0 siblings, 1 reply; 10+ messages in thread
From: Javier Gálvez Guerrero @ 2008-12-11 12:18 UTC (permalink / raw)
  To: netfilter

Hi all,

I need to route packets through different interfaces (let them be ath0
and eth0) depending on the application source port, so I thought using
TOS or MARK targets of iptables would be helpful.

Anyway, as I try configure it to mark the traffic and updating the
routing tables through many different ways, I can't get it working so
the packets are always sent through the "default" interface in the
main routing table.

For example, if I use MARK I configure it this way:

sudo iptables -A OUTPUT -t mangle -p tcp --dport 60301 -j MARK --set-mark 1
sudo iptables -A OUTPUT -t mangle -p tcp --dport 60302 -j MARK --set-mark 2

sudo ip rule add fwmark 1 table 1 prio 1
sudo ip rule add fwmark 2 table 2 prio 2

sudo ip route add table 1 nexthop via 192.168.0.1 dev ath0
sudo ip route add table 2 nexthop via 192.168.0.1 dev eth0


The routing tables and the iptables rules are properly updated but
packets I sent with these source ports are always sent through the
default interface in the main routing table (if I change this default
entry then the packets are sent through this again).


Any idea about what I am missing? Any help would be much appreciated.


Thank you,
Javi

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

end of thread, other threads:[~2008-12-12 14:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-11 12:18 Using MARK and TOS to route traffic through different interfaces to the same destination Javier Gálvez Guerrero
2008-12-11 12:33 ` Thomas Jacob
2008-12-11 12:41   ` Pascal Hambourg
2008-12-11 12:48     ` Thomas Jacob
2008-12-11 23:54       ` Philip Craig
2008-12-11 13:15     ` Javier Gálvez Guerrero
2008-12-12 10:33       ` Pascal Hambourg
2008-12-12 11:57         ` Javier Gálvez Guerrero
2008-12-12 12:42           ` Pascal Hambourg
2008-12-12 14:07             ` Javier Gálvez Guerrero

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