Solved

Trying to add a static route

Posted on 2007-11-13
7
10,453 Views
Last Modified: 2012-08-13
I am trying to add a static route:

route add 10.0.0.0 mask 255.0.0.0 10.1.1.10 IF 1

I get this error message:
The route addition failed: Either the interface index is wrong or the gateway do
does not lie on the same network as the interface. Check the IP Address Table for
the machine.

I have 2 network cards on this server one that is attatched to our internal network and 1 that is attatched to our outside network. I need to add a route on the internal interface that points back to our core switch. This is probably something dumb that I am missing.

Thanks in advance,
Rory
0
Comment
Question by:rorybrady
7 Comments
 
LVL 28

Expert Comment

by:batry_boy
ID: 20276499
My guess is that you have the wrong interface number specified.  If you issue the "route print" command, you will see a hex list of interface numbers at the top.  The hex number for your inside network adapter is the number you want to give the "route add" command.  I believe that "1" is typically the loopback adapter which is why you're getting the error...the output should look similar to the following:

Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 11 22 33 00 08 ...... Broadcom NetXtreme 57xx Gigabit Controller - Packet Scheduler Miniport

In this case, if I wanted to specify the NetXtreme adapter for that route, I would enter the command:

route add 10.0.0.0 mask 255.0.0.0 10.1.1.10 if 2
0
 

Author Comment

by:rorybrady
ID: 20276562
Thanks for your quick response! I am still having the same issue.

This is the out put for the route print:
Interface List
0x1 ........................... MS TCP Loopback interface
0x10003 ...00 11 43 d6 65 f5 ...... Intel(R) PRO/1000 MT Network Connection #2
0x10004 ...00 11 43 d6 65 f4 ...... Intel(R) PRO/1000 MT Network Connection
===========================================================================
===========================================================================

I would like to bound this route to local area connection 1. I changed the route command to look like this:
route add 10.0.0.0 mask 255.0.0.0 10.1.1.10 IF 4
I still get the same error message:
The route addition failed: Either the interface index is wrong or the gateway do
es not lie on the same network as the interface. Check the IP Address Table for
the machine.

Thanks,
Rory



0
 
LVL 28

Expert Comment

by:batry_boy
ID: 20276579
Based on your output, you should try:

route add 10.0.0.0 mask 255.0.0.0 10.1.1.10 IF 10004
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 28

Expert Comment

by:batry_boy
ID: 20276585
I'll admit that's a weird interface index number, but it is what it is...
0
 
LVL 40

Accepted Solution

by:
Fatal_Exception earned 500 total points
ID: 20276899
You might even use the entire Hex number, meaning 'if 0x10004'.   This should also work in your case..
0
 
LVL 11

Expert Comment

by:tvman_od
ID: 20277058
I'd recommend not to use interface number, just pint it to an IP of the gateway and let system decide which interface to use. Windows can renumber interfaces without any notifications. Besides that I'd recommend to add -p key to make this router persistent
0
 
LVL 40

Expert Comment

by:Fatal_Exception
ID: 20290703
Thanks, and have a great day!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

805 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