Re: Using MARK and TOS to route traffic through different interfaces to the same destination

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Thomas Jacob a écrit :
On Thu, 2008-12-11 at 13:18 +0100, Javier Gálvez Guerrero wrote:

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

These rules match the destination port. Replace --dport with --sport to match the source port.

AFAIK, locally generated packets are routed before they are sent to
netfilter, so setting fwmarks there to influence routing is pointless.

A rerouting happens after the OUTPUT chains in order to take into account destination NAT and marks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux