Interface bound routing

Linux Advanced Routing and Traffic Control

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

 



Hi,

I'm sorry for "novice"-level question, but I hope your expert advice will
save me many painful hours running after my own tail...

Let assume I have Linux box with eth0, eth1 and eth2 interfaces. Each one
has IP assigned from different network. By default, IP address associated
with eth0 is chosen as default routing.   My application creates thee TCP
sockets and explicitly bound them one to each of ethX interfaces. However,
due default gateway assigned to eth0 , all outgoing traffic is passing via
interface eth0, regardless on what socket used to send it .

QUESTION:
How can I configure my routing in such way that outgoing traffic always exit
the host by interface associated with transmitting socket ? ( I hear a
little about source routing and ideas from
http://lartc.org/howto/lartc.rpdb.html#LARTC.RPDB.SIMPLE are helping, but I
don't like idea to run "ip rule add from" each time my IP changed). I'm
looking to some simple way to instruct routing engine to forward packets via
associated interfaces.

Regards
Stas

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux