Solved

Adding route to other network using Windows "route" command

Posted on 2009-04-01
6
1,253 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now