Actually, John my treatises :) on this subject a year ago showed this.
ip classless
*only* affects the lookups *outside* the classful aggregate. Any
supernet *within* the classful aggregate *will* be used, even with
no ip classless
set.
Thus, a learned route, 10.1.0.0/16 , will be used for address 10.1.1.1
, but not 10.2.2.2 .
(*if* I still understand what I wrote below ;>).
Here is part of my original work on the subject for those who are
feeling drowsy, but just can't nod off completely ;>)
============================================
Thanks to the lab of
Ding So
I was able to pound the last nail in the coffin of how
[no] ip classless
affects route lookups (the doco makes no mention of route installation,
so we would guess that it has no effect. Further investigation will be
required to confirm/debunk this).
I will do a little write up, here, that can be challenged by anyone with
a dash of temerity:
(Note that I've tried several times and I just can't seem to
find a clear, yet succinct way to describe this.
)
======================================================
Under old, classful routing it was assumed that all local networks would
be subnets of one or a couple of classful networks and that all the
subnets of a particular classful network, say "X" (e.g., X=172.16.0.0),
would be "connected" to each other.
What this means is that, for each and every pair of subnets of classful
network "X", there would be an interconnecting path among 1 or more
routers, that could be traversed *entirely* on segments whose IP network
addresses are subnets of classful network "X".
If the above requirement does not obtain, i.e., if the network path
*must* include a subnet of a *different* classful network, say "Y", then
we call this situation
"a discontiguous network".
or "X has discontiguous subnets"
or "X has disconnected subnets"
.
Another assumption in this environment is that, if we (a router) know
about any particular subnet of "X", then we should know about *all*
subnets of "X" that actually exist; either by our having one or more
interfaces within a subnet of X, an admin giving us proper static
routes,
or by information received from a routing protocol.
With the above in mind, the router will not entertain a route to a
subnet of network "Y" that isn't a route to a network address *within*
network "Y" (it can be that actual network aggregate, itself; e.g., a
route to 172.16.0.0/16, in the above example) -- that would mean
discontiguity.
In particular, it will *not* consider the "default" route
0.0.0.0/0
for any address within classful Y, if it has information about at least
one subnet of Y.
In addition (and this is the one always left out of the textbooks), it
will not consider *any* *supernets* routes of Y. The 0.0.0.0/0 is just
a particular case of this rule (0.0.0.0/0 is always a supernet of
*every*
network address -- it contains *0* bits that do not match).
If you look at a
show ip route
you'll notice that the table is broken up into sections at *classful*
network boundaries, *even* if
ip classless
is set.
Note that supernet routes, including 0.0.0.0/0, are not listed within
any
classful section -- they are listed separately, on their own.
What the router does, with
no ip classless
set, is to first check to see if the target address in question falls
within one of these "known" sections -- i.e., in one of the "known"
classful networks. If so, he will use the *longest* match for the
target
address that he can find in that section.
(Note that this is a point also often left out of the text books.
Remember: a router will *always* try to do a longest-prefix match,
except for the constraint mentioned here, for 'no ip classless.
)
*But*, he will *not* look *outside* that section (classful network),
when
no ip classless
is set.
With the advent of the Internet and CIDR and "prefixes", the above logic
may not be good enough. When considering a given prefix and because of
the vagaries of the way addresses were handed out in the beginning, it
is very possible that "subnets" of that prefix (addresses with a longer
prefix, but yet still matching the original prefix in question) may
be disconnected. Of course, this is a situation that is trying to be
remedied, but it is still possible.
So, now, it is very desirable to try "supernet" routes, in particular
the ever-hopeful "default" route, 0.0.0.0/0.
(Actually, in this "prefix" environment, the concept of "supernet"
and "subnet" disappear. Every route is simply a summary or
aggregate route to a bunch of possible addresses.
)
This is what
ip classless
does. It allows the router look *outside* the classful "section"
(It can "think outside the lines", if you just *have* to use
that terminology:>)
)
In fact, the router doesn't care about the "sections" (classful
networks) anymore.
He simply uses the longest match that he can find anywhere in the table,
including supernets.
E.g., suppose that the router knows about subnets
172.16.1.0 /16 ...
and 172.16.2.0 /16 ...
and also has a supernet route
172.0.0.0 /8 ...
.
The classful, 'no ip classless' router thinks to himself,
"OK. I've got classful network 172.16.0.0 /16 covered.
There are exactly *2* subnets of that network that we are using.
Any other request for other subnets must be a program gone bad,
generating erroneous target addresses.
"
Suppose that we then (being the incorrigible rogues that we are ;>)
ping 172.16.44.1
.
Well, the router will say that he has no route to that network!!!
He will *not* look to the supernet route because he thinks that he
should
know about *all* subnets of 172.16.0.0 /16.
When we simply turn on
ip classless
then a
ping 172.16.44.1
will be sent out the 172.0.0.0/8 supernet route.
As a reminder, it *doesn't matter* where the information about a subnet
came from. It could be:
. an "attached" subnet (one of our interfaces is in the subnet
. a static route entered by an admin, for whatever reason (like
testing the above logic ;>)
. a route learned by a routing protocol
Reading from the online 11.3 CCO
(watch wrap and trademark-infringement protection) :
www. c*sco .com/univercd/cc/td/doc/product/software/
ios113ed/113ed_cr/np1_r/1ripadr.htm#xtocid2512611
we find the following:
"""""""""""
At times the router might receive packets destined for a subnet of a
network that has no network default route. To have the C*sco IOS
software
forward such packets to the best supernet route possible, use the ip
classless global configuration command. To disable this feature, use the
no form of this command.
...
This command allows the software to forward packets that are destined
for
unrecognized subnets of directly connected networks. By default, the
software discards the packets when a router receives packets for a
subnet
that numerically falls within its subnetwork addressing scheme, if there
is no such subnet number in the routing table and there is no network
default route. However, when the ip classless command is enabled, the
software instead forwards those packets to the best supernet route.
"""""""""""
After our preceding analysis, it's a lot easier to comprehend what this
doco is trying to say. Notice how, even though being technically
correct, it mixes important components of our preceding discussion,
talking about best supernet routes and yet talking about
"directly-connected" subnets.
-------------------------------------------------
Tks | <mailto:[EMAIL PROTECTED]>
BV | <mailto:[EMAIL PROTECTED]>
Sr. Technical Consultant, SBM, A Gates/Arrow Co.
Vox 770-623-3430 11455 Lakefield Dr.
Fax 770-623-3429 Duluth, GA 30097-1511
=================================================
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
John Neiberger
Oops, I just re-read your post and see that you were talking about
advertising a specific major net, not the 0.0.0.0/0 default.
_________________________________
FAQ, list archives, and subscription info: http://www.groupstudy.com/list/cisco.html
Report misconduct and Nondisclosure violations to [EMAIL PROTECTED]