Any way to force the use of a defined host static route when the IP is on the same subnet and disregards the static route entry?

For instance I have a host host: 192.168.1.2 with subnet 255.255.255.0 and a default of 192.168.1.1

I'd like to communicate with 192.168.1.3 via 192.168.1.102.

link|improve this question

72% accept rate
feedback

3 Answers

up vote 2 down vote accepted

Add the entry to the routing table:

Windows

route add 192.168.1.3 mask 255.255.255.255 192.168.1.102

Linux

route add -host 192.168.1.3 gw 192.168.1.102

However, you will likely have an asymmetric routing condition when return traffic from 192.168.1.3 returns to your 192.168.1.2 host. That return traffic, unless otherwise configured with a similarly mirrored route, will be directly delivered.

link|improve this answer
feedback

Is this Windows? Linux? AIX?

For Windows, this command works fine:

route add 192.168.1.3 mask 255.255.255.255 192.168.1.102

Even if you're inside the 192.168.1.0/24 network, it will attempt to route. I can't vouch for behaviour on other OS's.

link|improve this answer
feedback

As stated already, the route to the destination is localy changeable. The way back isn't this way. The reply packets will arrive you direct from host 192.168.1.3. Next, you must make sure. that 192.168.1.102 will forward packages.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.