Link to home
Start Free TrialLog in
Avatar of shanraj
shanraj

asked on

Adding route to other network using Windows "route" command

Hello all,

My windows machine is on 192.168.1.X network. There's another machine installed two network cards and each one is connected to two different networks. For ex the eth0 is on the same network where my first windows machine is (192.168.1.X). The eth1 is connected to 14.1.1.X network.

Now i used the following command on my first windows machine.

route add 14.1.1.0 mask 255.255.255.0 192.168.1.1

Here the 192.168.1.1 is the machine installed with two nics and have access to both the networks.

When I execute the above said command, i get the following error.

"The route addition failed: Either the interface index is wrong or the gateway does
not lie on the same network as the interface. Check the IP Address Table for
the machine."

Can some one help here..? Thanks in advance.
Avatar of JFrederick29
JFrederick29
Flag of United States of America image

Can you post a route print from the windows machine you are trying to add the route to?
Avatar of shanraj
shanraj

ASKER

Ok. Let me try to explain in detail. Please find attached the image which can give you an view about my network.

System A installed with two NICs is connected with network A and network B. System A installed with one NIC and connected with network C. Network B and Network C are connected using the route shown.

Assume that actually there are several networks between Network B and Network C. Now from the system B, I'm trying to access the system C. I enabled port forwarding in System A. I used the following command to add route to the System C from System B.

route add 14.1.1.5 mask 255.255.254.0 192.168.1.10

I get the following error.

"The route addition failed: Either the interface index is wrong or the gateway does not lie on the same network as the interface. Check the IP Address Table for the machine."

If i execute the same command in a system which is connected with network B there's no error and I could able to access all the system connected in network A.

Is it a problem with route command..? or am i missing something...?

Please help.
route.jpg
Your route statement on System B should be:

route add 14.1.1.0 mask 255.255.255.0 172.168.1.x  <--the router 172.168.1.x IP

or it should have a default gateway of the 172.168.1.x router IP.

The next hop in the route statement needs to be local to the hosts subnet.

System C should either have a default gateway of 14.1.1.10 or needs a route to 172.168.1.0 via 14.1.1.10.

System A should have a default gateway of the 192.168.1.x router IP or if not a route to the 172.168.1.0 subnet via the 192.168.1.x router IP.

Lastly, the "router" needs a route to 14.1.1.0/23 via 192.168.1.10.
Avatar of shanraj

ASKER

Thanks JFrederick29,

Looks like i'm trying to do something which is not possible with route command..  I don't have control over the router shown in the diagram. As an example I have shown only one router there. In fact there are so many networks present in between network B and Network C.

The goal is to access the applications running in System C from System B. Is there any other way other than route command..? Like installing a proxy server in System A to forward the requests to System C. Will it work..?


ASKER CERTIFIED SOLUTION
Avatar of JFrederick29
JFrederick29
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial