Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding route to other network using Windows "route" command

Posted on 2009-04-01
6
Medium Priority
?
1,289 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

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 500 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 500 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
Tech spooks aren't just for those who are tech savvy, it also happens to those of us running a business. Check out the top tech spooks for business owners.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

636 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