Solved

Trying to add a static route

Posted on 2007-11-13
7
10,462 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
[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
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
Webinar June 1st - Attacking Ransomware  

The global cyberattack that corrupted hundreds of thousands of computer systems on May 12th had a face, name, & price tag that we’ve seen all too often in recent years: Ransomware. With the stakes – and costs – of a ransomware attack higher than ever, is your business prepared ?

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
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.
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…

732 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