"classless" is a bit of a misnomer, but it might be easier to understand "classful" behavior.
Leo's post above sort of explains it.
Classful behavior:
If I have a route table that has the following routes:
172.16.1.0 -- interface X
172.16.2.0 -- interface X
172.16.4.0 -- interface Y
192.168.1.0 -- interface X
0.0.0.0 0.0.0.0 (default) - interface Z
If I receive a packet destined for 172.16.6.66 - not in my route table. What would you expect to happen? Throw it out the default? Nope. It is within a classful boundary and I know routes to some of those networks, but not this particular one. Drop it. If I have a packet destined for 192.168.222.22 what am I going to do with it? Toss it out the default. Why? Because it is a classful network boundary.
'ip classless' merely changes this behavior so that if I don't have a specific route to that specific subnet, regardless of class of network, regardless of what else is in my route table, then I pass it out the default.
Another example. Say I only have two interfaces to route between. One interface connected to another router where I will learn some routes to some subnets. One interface connected to my firewall - my default route..
To make it easy on myself, I setup static routes only:
ip route 10.10.0.0 255.255.0.0 interface Serial 0/0.123
ip route 0.0.0.0 0.0.0.0 192.168.122.1
Without "ip classless" a packet destined for 10.11.0.0 will simply be dropped, but perhaps I want it to go out the firewall because that is my remote LAN through a firewall VPN (true example of discontiguous subnets). Add "ip classless" and now it works. Packets destined for 10.11.0.0 not magically get forwarded to the firewall, through the VPN and live happily ever after..
Main Topics
Browse All Topics





by: -Leo-Posted on 2005-03-29 at 21:02:38ID: 13659004
Yes, it serves to overcome discontiguous subnets :)
This is a part of CCNA manual:
A default route has a network number of 0.0.0.0 and a subnet mask of 0.0.0.0.
Must configure the following command to accept nonconforming subnet masks, such
as a default route: Router(config)# ip classless
This command is also used to deal with discontiguous subnets in a network that is
using a classful protocol: subnets separated by a different class network.
For example, let’s assume that you have networks 172.16.1.0/24, 172.16.2.0/24, and 172.16.3.0/24.
However, a different class network, 192.168.1.0/24, sits between the first two Class B
subnets and 172.16.3.0/24. In this situation, the router connected to 172.16.1.0/24 and
172.16.2.0/24, when it receives 172.16.0.0 from the side of the network connected to
the discontiguous subnet, will ignore this routing entry.
Remember that when routes cross a class boundary in a classful protocol, the network
number is sent as its classful number. Therefore, the router connected to 192.168.1.0/24
and 172.16.3.0/24, when it advertises updates across the 192.168.1.0/24 subnet, will
advertise 172.16.0.0—not the actual subnet number. Since the router connected to
172.16.1.0/24 and 172.16.2.0/24 ignores the 172.16.0.0 routing information, it will
not be able to reach 172.16.3.0. On top of this problem, even if you have a default
route configured, since the router is connected to the 172.16.0.0 subnets, it assumes
that 172.16.3.0 must also be connected; and if it isn’t in the routing table, then the
route cannot be reached.
By using the ip classless command, you are overriding this behavior; you’re
allowing your classful router to use a default route to reach discontiguous subnets.
Not that this is a recommended design practice, but it does allow you to solve
reachability problems for discontiguous subnets.