Solved

Adding route to other network using Windows "route" command

Posted on 2009-04-01
6
1,258 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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Routing between two networks? 10 56
multiple application databases same MSSQL instance 5 56
DNS issue with resolving request 14 87
Setting up static routes to  sonicwll 4 41
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

809 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