Routing with different subnets

F

Fred Marshall

If I add a route like this in XP with the local interface being
192.168.113.139:

route add 192.168.116.0 mask 255.255.255.0 192.168.113.157 metric 1 IF
192.168.113.139

Then the resulting message is:

"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."

* The interface is explicitly stated to be the machines own (and only)
interface 192.168.113.139 (and has a subnet mask of 255.255.255.224)

*The gateway is on the same subnet at 192.168.113.157 (and has a subnet mask
of 255.255.255.224)

So, I conclude that since the gateway and the interface do lie on the same
network then this isn't the problem (?)

Also, the interface isn't "wrong".

And, I can check the IP address table for the machine until hell freezes
over (which, I presume means the Routing Table?) but what would I be looking
for?

So, I can't interpret the message offhand and I'm stuck.

Here's what I want to do:

I want to initiate packets to an IP address that is *not* on the local
subnet and not destined for the default interface either.
I want to direct those packets to a particular local subnet address (a VPN
node). So, from above:

192.168.113.139 is the local host address that initiates the packet.
192.168.116.0 / 255.255.255.0 is the range to which the packets will be
destined.
192.168.113.157 is the local address of the VPN router (which has a tunnel
for the destined range .. but this is of no matter here because I can't set
up the route on the local host).

I don't want to next hop these packets to the default because they are
destined for a private network.

I'm missing something rather basic I'm afraid.

Thanks,

Fred
 
J

James Egan

route add 192.168.116.0 mask 255.255.255.0 192.168.113.157

The first number is the network address 192.168.116.0

With a mask of 255.255.255.0 that makes the subnet nodes to be from
192.168.116.1 to 192.168.116.254 inclusive

The number at the end (the gateway) has to be within this node range.

In your example, it isn't. Hence the error.


Jim.
 
S

Steve Winograd [MVP]

"Fred Marshall" said:
If I add a route like this in XP with the local interface being
192.168.113.139:

route add 192.168.116.0 mask 255.255.255.0 192.168.113.157 metric 1 IF
192.168.113.139

Then the resulting message is:

"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."

* The interface is explicitly stated to be the machines own (and only)
interface 192.168.113.139 (and has a subnet mask of 255.255.255.224)

*The gateway is on the same subnet at 192.168.113.157 (and has a subnet mask
of 255.255.255.224)

So, I conclude that since the gateway and the interface do lie on the same
network then this isn't the problem (?)

Also, the interface isn't "wrong".

And, I can check the IP address table for the machine until hell freezes
over (which, I presume means the Routing Table?) but what would I be looking
for?

So, I can't interpret the message offhand and I'm stuck.

Here's what I want to do:

I want to initiate packets to an IP address that is *not* on the local
subnet and not destined for the default interface either.
I want to direct those packets to a particular local subnet address (a VPN
node). So, from above:

192.168.113.139 is the local host address that initiates the packet.
192.168.116.0 / 255.255.255.0 is the range to which the packets will be
destined.
192.168.113.157 is the local address of the VPN router (which has a tunnel
for the destined range .. but this is of no matter here because I can't set
up the route on the local host).

I don't want to next hop these packets to the default because they are
destined for a private network.

I'm missing something rather basic I'm afraid.

Thanks,

Fred

The IF parameter is invalid, and you don't need to specify it. Try
the command without it:

route add
192.168.116.0 mask 255.255.255.0 192.168.113.157 metric 1

If this is the only route to the desired range, you don't need to
specify the metric either:

route add
192.168.116.0 mask 255.255.255.0 192.168.113.157

If present, IF gives the interface number, not the IP address, to use.
Interface numbers are decimal or hex numbers (e.g. 1, 0x1, 0x50006),
and appear in the "Interface List" at the start of the "route print"
output.
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
S

Steve Winograd [MVP]

James Egan said:
The first number is the network address 192.168.116.0

With a mask of 255.255.255.0 that makes the subnet nodes to be from
192.168.116.1 to 192.168.116.254 inclusive

The number at the end (the gateway) has to be within this node range.

In your example, it isn't. Hence the error.


Jim.

The gateway that Fred gave is valid.

The gateway doesn't have to be in the range defined by the network
address and subnet mask. In fact, I can't think of a useful example
where it would be.

In a "route add" command, the network address and subnet mask define a
range of IP addresses that aren't on a local subnet. The gateway
address must be on a local subnet. Packets addressed to the non-local
addresses are routed through the local gateway.
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
J

James Egan

The gateway that Fred gave is valid.

Yes. You're right. Not sure what I was thinking about there. That's
what comes of doing too many things at once.


Jim.
 
F

Fred Marshall

Steve Winograd said:
The gateway that Fred gave is valid.

The gateway doesn't have to be in the range defined by the network
address and subnet mask. In fact, I can't think of a useful example
where it would be.

In a "route add" command, the network address and subnet mask define a
range of IP addresses that aren't on a local subnet. The gateway
address must be on a local subnet. Packets addressed to the non-local
addresses are routed through the local gateway.

Steve,

OK - thanks. That helps and it works with less "information" provided as
you suggest.

Now, what if the gateway is on a subnet different than the host? That
doesn't seem to work either. The error message says as much.

Fred
 
S

Steve Winograd [MVP]

"Fred Marshall" said:
Steve,

OK - thanks. That helps and it works with less "information" provided as
you suggest.

Now, what if the gateway is on a subnet different than the host? That
doesn't seem to work either. The error message says as much.

Fred

You're welcome, Fred. The gateway in a "route add" command must be on
one of the host's local subnets. If it isn't, then you need a second,
local gateway (and a route) to send packets to the first, non-local
gateway.

In the absence of any subnet or host route, packets addressed to
unknown IP addresses are sent to the default gateway. The default
gateway is presumably a router with connections to other subnets (like
the Internet).
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
F

Fred Marshall

Steve,

Thanks! That helped.

Fred

Steve Winograd said:
The IF parameter is invalid, and you don't need to specify it. Try
the command without it:

route add
192.168.116.0 mask 255.255.255.0 192.168.113.157 metric 1

If this is the only route to the desired range, you don't need to
specify the metric either:

route add
192.168.116.0 mask 255.255.255.0 192.168.113.157

If present, IF gives the interface number, not the IP address, to use.
Interface numbers are decimal or hex numbers (e.g. 1, 0x1, 0x50006),
and appear in the "Interface List" at the start of the "route print"
output.
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
S

Steve Winograd [MVP]

"Fred Marshall" said:
Steve,

Thanks! That helped.

Fred

You're welcome, Fred!
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
F

Fred Marshall

Here's another posting I've put up and I repeat it here with your
indulgence:

I have two sites connected by a VPN using Linksys RV042.
It appears the RV042 will only act as a VPN device and not as a router at
the same time.
(I'm investigating this further but it's my current belief).
Subnet#1 192.168.1.0/24
Subnet#2 192.168.2.0/24
Subnet#3 192.168.3.0/24

There is a router on subnet#2, say at 192.168.2.99 that is multihomed and
can route to subnet#3. Subnet#3, the interface that connects to it and the
link are all outside of my control.

The VPN connects Subnet#1 to Subnet#2

Subnet#1 VPN is at 192.168.1.254
Subnet #1 can have a gateway router say at 192.168.1.99
The hosts are Windows XP

Subnet#2 VPN is at 192.168.2.254
Subnet#2 router is at 192.168.2.99 and 192.168.3.99

How should I configure the hosts and the routers to launch a packet from
192.168.1.x and have it end up at 192.168.3.x??

I'm stumped - because I'm hung up on having a subnet-wide route for the VPN
traffic and another route that points to 3.x but has to go through the VPN
from 1.x to 2.99. How to handle both things?

Thanks,

Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top