Solved

Adding route to other network using Windows "route" command

Posted on 2009-04-01
6
1,261 Views
Last Modified: 2013-12-14
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.
0
Comment
Question by:shanraj
  • 3
  • 2
6 Comments
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24041700
Can you post a route print from the windows machine you are trying to add the route to?
0
 

Author Comment

by:shanraj
ID: 24062047
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
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24062200
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.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:shanraj
ID: 24122480
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..?


0
 
LVL 43

Accepted Solution

by:
JFrederick29 earned 125 total points
ID: 24123857
If you have no control of the router and you can't put a route on it for the C network, you could NAT System C to a B network IP on System A (if capable of running RRAS for example).  The router wouldn't need to route or know about the C network.
0
 
LVL 6

Assisted Solution

by:segurah
segurah earned 125 total points
ID: 24165031
Your problem is simple.

Your first machine only have one ethernet card in the subnet 192.168.1.X then it only can 'see' machines in this subnet (ip's like 192.168.1.X) if it wish reach an ip out this subnet the only way is using this unique default gateway (192.168.1.1). As you can reach directly the subnet 14.1.1.X (from your first machine) you can't define a route (especific route). The only thing that you can do is declare a default (generic/unique) gateway.

You can route when you have choices (more than 1 card). In your 2nd machine you can define routes.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question