[clug] A Routing problem

Martijn van Oosterhout kleptog at svana.org
Wed Oct 20 16:01:57 GMT 2004


You may be able to do this using rules. Maybe something like:

ip rule add dev eth2 to 123.123.123.0/24 table 500 pref 500
ip rule add dev eth0 to 123.123.123.0/24 table 501 pref 501

ip route add 123.123.123.0/24 dev eth2 table 500
ip route add 123.123.123.0/24 dev eth0 table 501

Be aware this is asymmetric routing and you'll get all the issues
related to that. I'm not totally sure about the syntax, nor whether the
"dev" argument represents the incoming interface, but it should point
you in the right direction.

Hope this helps,

On Wed, Oct 20, 2004 at 07:38:52PM +1000, Stephen Hodgman wrote:
> I have a question regarding routing.  I have a linux system with three 
> interfaces say eth0, eth1 & eth2
> 
> On eth0 is network 123.123.123.0/24 (say)
> I want traffic entering eth1, destined for 123.123.123.0/24 to be routed 
> to eth0 - always
> I want traffic entering from eth2 destined for 123.123.123.0/24 to be 
> routed to eth2 - always
> The reason is that there is a route either way but I only want one 
> device to route directly.
> 
> Can this be done?  It seems to require routing tables based on source 
> address/interface.
> I would appreciate knowing how this can be done.
> TIA.
> 
> -- 
> Steve Hodgman
> Ph: +61 2 6285 3460
> Fax: +61 2 6285 3459
> Mobile:	+61 407 182 355
> steve at namsys.com.au
> ------------------------
> This message and its attachments contain confidential information and may 
> also contain legally privileged information. This message is intended 
> solely for the named addressee. If you are not the addressee indicated in 
> this message or have received this message in error, you may not copy or 
> deliver any part of this message or its attachments to anyone or use any 
> part of this message or its attachments. Instead, you should permanently 
> delete this message and its attachments (and all copies) from your system 
> and kindly notify the sender by reply e-mail. Any content of this message 
> and its attachments that does not relate to the official business of 
> Namadgi Systems must be taken not to have been sent or endorsed by the 
> company or its management.
> ------------------------
> 

> -- 
> linux mailing list
> linux at lists.samba.org
> http://lists.samba.org/mailman/listinfo/linux


-- 
Martijn van Oosterhout   <kleptog at svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20041020/6c8dde6a/attachment.bin


More information about the linux mailing list