On Thu, Mar 07, 2002 at 03:51:09PM -0800, Neale Pickett wrote: > > Where A's configured like this: > > Linux 2.4.12 > eth0 192.168.1.1/24 > eth1 10.1.1.1/24 > > And B is configured like this: > > Firewall box by $FIRM > eth2 192.168.1.2/24 > eth3 10.1.1.2/24 > > B is also acting as a router from 10.1.1.0/24 to 192.168.1.0/24 and back. > > Now for the question: how can I tell A that for all packets from > 192.168.1.1 to 10.1.1.1, it needs to use 192.168.1.2 as a gateway? The > best idea I've had so far is this: > > ip route add 192.168.1.1 via 192.168.1.2 dev eth0 src 10.1.1.1 >
You can't. There is such a thing as "administrative distance" as cisco calls it. The precedence of a connected interface is higher than a static route (which is logical, except for your needs). I don't know how linux's IP stack behaves but I will not be surprised if connected interface takes precedence over statics. Ramin
