cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
529
Views
18
Helpful
4
Replies

question regarding ip classless

marcusbrutus
Level 1
Level 1

I read that one needs to put in the command - "ip classless" in the router even if you have configured a default route. Can anyone explain why this is necessary when a default route has already been configured? Furthermore, i would really appreciate it if anyone can explain to me what the "ip classless" command actually does. Thank you.

1 Accepted Solution

Accepted Solutions

Harold Ritter
Cisco Employee
Cisco Employee

I would like to first say that this command doesn't serve any purpose if CEF is configured on the router, which is the case with most routers these days. Also "ip class less" has been the default for a while in IOS. Here's the explanation of the behavior of that command for discussion sake.

"ip classless" dictates a classless routing behavior, which means that the longest match against the RIB is not limited to the majornet of the destination address.

"no ip classless" is just the opposite, which means that the longest match against the RIB is limited to the majornet of the destination address, if the majornet does exist in the RIB.

Here's example of the "no ip classless" behavior. Let say a packet comes in with a destination address of 172.16.24.1 and that there is some entries in the RIB for other subnets belonging to the same majornet (172.16.0.0/16) but none that are matching 172.16.24.1. The packet would be dropped even if there is a default route installed in the RIB since the longest match is limited to the majornet in this case. It goes without saying that this restriction would not apply if "ip classless" was configured.

Hope this helps,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

View solution in original post

4 Replies 4

walleyewiz
Level 1
Level 1

ip classless command enables the router to forward packets to unknown subnets of directly connected networks.

A classful route lookup is when the router matches the destination address to the major network, and then matches to the subnet of the major network. If no match is found, the packet is dropped. Classful lookup was the default on IOS until 11.3, it was changed to classless lookup after that.

Classless route lookups do not pay attention to the class of the destination address.

So, to answer your question--if you have a default route and you are using classful routing the packet will be dropped because the destination address cannot be matched in the routing table.

Any router using a default route must perform a classless route lookup for the reasons stated above.

HTH.

Harold Ritter
Cisco Employee
Cisco Employee

I would like to first say that this command doesn't serve any purpose if CEF is configured on the router, which is the case with most routers these days. Also "ip class less" has been the default for a while in IOS. Here's the explanation of the behavior of that command for discussion sake.

"ip classless" dictates a classless routing behavior, which means that the longest match against the RIB is not limited to the majornet of the destination address.

"no ip classless" is just the opposite, which means that the longest match against the RIB is limited to the majornet of the destination address, if the majornet does exist in the RIB.

Here's example of the "no ip classless" behavior. Let say a packet comes in with a destination address of 172.16.24.1 and that there is some entries in the RIB for other subnets belonging to the same majornet (172.16.0.0/16) but none that are matching 172.16.24.1. The packet would be dropped even if there is a default route installed in the RIB since the longest match is limited to the majornet in this case. It goes without saying that this restriction would not apply if "ip classless" was configured.

Hope this helps,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Hi there,

I Just want to add a comment here:

If the supernet or default route is learned via IS-IS or OSPF, the no ip classless configuration command is ignored. In this case, packet switching behavior works as though ip classless were configured.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094823.shtml

HTH,

Mohammed Mahmoud.

Very good info! Cleared it up for me too! Thanks!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: