routing table rules

  • Thread starter Thread starter Fred Marshall
  • Start date Start date
F

Fred Marshall

I want to clarify something about setting up routes in Windows XP:

If there's a general subnet route:

192.168.1.0 255.255.255.0 192.168.1.2

(which I understand to mean that anything on subnet 192.168.2.0 goes to
192.168.2.1

And, in addition, one needs a specific route within that subnet that's
different, then it appears that:

192.168.2.33 255.255.255.0 192.168.1.17

doesn't work.

But

192.168.2.33 255.255.255.255 192.168.1.17

does work.

Why?

However.... the entry for the last one appears in the routing table after
the more general one. So, it wouldn't be reached it appears. ???

Thanks,

Fred
 
1. I think "192.168.1.0 255.255.255.0 192.168.1.2" should be "192.168.1.0 255.255.255.0 192.168.2.1"
2. 192.168.2.33 255.255.255.0 192.168.1.17: we need more information about this one. from which IP? what's IP 192.168.1.17? gateway?

Bob Lin, MS-MVP, MCSE & CNE
Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net
How to Setup Windows, Network, VPN & Remote Access on http://www.HowToNetworking.com
I want to clarify something about setting up routes in Windows XP:

If there's a general subnet route:

192.168.1.0 255.255.255.0 192.168.1.2

(which I understand to mean that anything on subnet 192.168.2.0 goes to
192.168.2.1

And, in addition, one needs a specific route within that subnet that's
different, then it appears that:

192.168.2.33 255.255.255.0 192.168.1.17

doesn't work.

But

192.168.2.33 255.255.255.255 192.168.1.17

does work.

Why?

However.... the entry for the last one appears in the routing table after
the more general one. So, it wouldn't be reached it appears. ???

Thanks,

Fred
 
"Fred Marshall" said:
I want to clarify something about setting up routes in Windows XP:

If there's a general subnet route:

192.168.1.0 255.255.255.0 192.168.1.2

(which I understand to mean that anything on subnet 192.168.2.0 goes to
192.168.2.1

That route says that traffic for anything on subnet 192.168.1.0 goes
to 192.168.1.2.

Here's a route that says that anything on subnet 192.168.2.0 goes to
192.168.2.1. Is this what you meant?

192.168.2.0 255.255.255.0 192.168.2.1
And, in addition, one needs a specific route within that subnet that's
different, then it appears that:

192.168.2.33 255.255.255.0 192.168.1.17

doesn't work.

That route doesn't work because no IP address can match it. There's a
zero in the fourth octet of the subnet mask, but the fourth octet of
the destination address is 33:

192.168.2.33 AND 255.255.255.0 = 192.168.2.0
But

192.168.2.33 255.255.255.255 192.168.1.17

does work.

Why?

That route works because IP address 192.168.2.33 matches it:

192.168.2.33 AND 255.255.255.255 = 192.168.2.33
However.... the entry for the last one appears in the routing table after
the more general one. So, it wouldn't be reached it appears. ???

When more than one route can reach a destination address, the route
with the longest subnet mask is used. The order in which routes
appear in the route table is irrelevant.
Thanks,

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
 
Steve Winograd said:
That route says that traffic for anything on subnet 192.168.1.0 goes
to 192.168.1.2.

Here's a route that says that anything on subnet 192.168.2.0 goes to
192.168.2.1. Is this what you meant?

192.168.2.0 255.255.255.0 192.168.2.1


That route doesn't work because no IP address can match it. There's a
zero in the fourth octet of the subnet mask, but the fourth octet of
the destination address is 33:

192.168.2.33 AND 255.255.255.0 = 192.168.2.0


That route works because IP address 192.168.2.33 matches it:

192.168.2.33 AND 255.255.255.255 = 192.168.2.33


When more than one route can reach a destination address, the route
with the longest subnet mask is used. The order in which routes
appear in the route table is irrelevant.

Steve,

Thanks again! That's very useful to know. Where might one find these kinds
of "rules"? I've Googled but nothing seemed to pop out that did it.

I'm getting the impression that the "mask" in a route add doesn't have quite
the same meaning as a host subnet mask, right?

Fred
 
"Fred Marshall" said:
Steve,

Thanks again! That's very useful to know. Where might one find these kinds
of "rules"? I've Googled but nothing seemed to pop out that did it.

You're welcome, Fred. Here's a good article from Microsoft:

Understanding the IP Routing Table
http://www.microsoft.com/technet/community/columns/cableguy/cg1201.mspx
I'm getting the impression that the "mask" in a route add doesn't have quite
the same meaning as a host subnet mask, right?

Right. I think that article will show the difference.
--
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
 
Back
Top