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
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 P.S. Sorry for posting my question again - didn''t received any responses yet ;-(