# Cisco IP Classless Command

**URL:** https://forum.networklessons.com/t/cisco-ip-classless-command/1273
**Category:** Lessons Discussion
**Created:** [December 29, 2016, 7:57pm UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273 "2016-12-29T19:57:03Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [December 29, 2016, 7:57pm UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/1 "2016-12-29T19:57:03Z")

</div>

This topic is to discuss the following lesson:

[https://networklessons.com/cisco/ccie-enterprise-infrastructurecisco-ip-classless-command/](https://networklessons.com/cisco/ccie-enterprise-infrastructurecisco-ip-classless-command/)

---

<div class="post-metadata">

### Author: ![chris.m.chavez](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/c/58f4c7/32.png) [@chris.m.chavez](https://forum.networklessons.com/u/chris.m.chavez)
#### Post date: [July 20, 2015, 2:17am UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/2 "2015-07-20T02:17:22Z")

</div>

Rene,

Hello, thanks for the explanation of this, it is nice to finally have an understanding of this command.

Chris

---

<div class="post-metadata">

### Author: ![kanth.kapil](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/k/e99b99/32.png) [@kanth.kapil](https://forum.networklessons.com/u/kanth.kapil)
#### Post date: [December 8, 2016, 10:07am UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/3 "2016-12-08T10:07:56Z")

</div>

Hi Rene,

Great explanation but I think it should be 172.16.0.0/16 is subnetted, 2 subnets rather than /24.

correct me if i am wrong.

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [December 12, 2016, 7:55am UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/4 "2016-12-12T07:55:23Z")

</div>

Hello Kapil

It is true that the 172.16.0.0 subnet is a class B address, and thus in clasful IP addressing it would have a prefix of /16 rather than /24. However, classless and classful routing should not be confused with classless and classful **addressing or routing protocols**.

Having said that, it can be confusing when the routing table states that:

```auto
R1#show ip route static
&lt;strong&gt;172.16.0.0/24 is subnetted, 2 subnets&lt;/strong&gt;
S 172.16.0.0 [1/0] via 192.168.12.2
S 172.16.1.0 [1/0] via 192.168.12.2
S* 0.0.0.0/0 [1/0] via 192.168.12.2

```

For reference purposes, keep in mind that the bold line above is called a parent route, and the two lines below it are child routes.

It seems like what it is saying is that the 172.16.0.0/24 **network** is being subnetted into 2 subnets. That should mean that the prefix of the parent route should be smaller than that of the child routes. But here, both the parent and child prefixes are the same size (/24). Let’s experiment a bit. I tried creating different routing tables and found the following:

1. When the child subnets are the same size, the prefix of the child subnets is indicated in the parent route:

```auto
Router#show ip route
Gateway of last resort is not set
     172.16.0.0/24 is subnetted, 3 subnets
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.32.0 is directly connected, Loopback3
Router#

```

Similarly in this example:

```auto
Router#show ip route
Gateway of last resort is not set
     10.0.0.0/25 is subnetted, 3 subnets
C 10.10.10.0 is directly connected, Loopback10
C 10.10.11.0 is directly connected, Loopback11
C 10.10.12.0 is directly connected, Loopback12
Router#

```

1. When the child subnets are not the same size, that is they are variably subnetted, then the prefix of the parent route reverts to the classful prefix:

```auto
Router#show ip route
Gateway of last resort is not set
     172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 172.16.1.0/24 is directly connected, Loopback1
C 172.16.2.0/24 is directly connected, Loopback2
C 172.16.5.0/25 is directly connected, Loopback4
C 172.16.32.0/24 is directly connected, Loopback3
Router#

```

1. Finally, if the subnet mask is smaller than the classful mask of the network, no parent route is created but each route is displayed individually:

```auto
Router#show ip route
Gateway of last resort is not set
C 192.168.0.0/23 is directly connected, Loopback20
C 192.168.2.0/23 is directly connected, Loopback21
Router#

```

Keep in mind that all of the above is true only for 12.X versions of Cisco IOS. In version 15.X, the routing table includes a `local` route with a prefix of /32. This results in all routes always being variably subnetted, thus all parent routes will always display their classful prefixes. Here is an example of such a routing table:

```auto
Router#show ip route
Gateway of last resort is not set
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.10.0/24 is directly connected, Loopback5
L 10.10.10.1/32 is directly connected, Loopback5
     172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
C 172.16.1.0/24 is directly connected, Loopback1
L 172.16.1.1/32 is directly connected, Loopback1
C 172.16.2.0/24 is directly connected, Loopback2
L 172.16.2.1/32 is directly connected, Loopback2
C 172.16.3.0/24 is directly connected, Loopback3
L 172.16.3.1/32 is directly connected, Loopback3
C 172.16.4.0/24 is directly connected, Loopback4
L 172.16.4.1/32 is directly connected, Loopback4
Router#

```

So to summarize, in version 12.X, if all child routes have the same prefix, parent routes always display that prefix. If they are variably subnetted, the classful prefix is displayed. If you are using IOS version 15.X, parent routes are always variably subnetted thus they display the classful prefix.

I hope this has been helpful!

---

<div class="post-metadata">

### Author: ![kanth.kapil](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/k/e99b99/32.png) [@kanth.kapil](https://forum.networklessons.com/u/kanth.kapil)
#### Post date: [December 12, 2016, 6:24pm UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/5 "2016-12-12T18:24:22Z")

</div>

Thanks for the explanation .. I think now I get it I have never worked on 12.X version of the IOS as it was already out of date by the time i started learning networking. So I thought it is weird.

Extremely detailed answer. Thanks again

---

<div class="post-metadata">

### Author: ![andysjunkmale](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/a/9de053/32.png) [@andysjunkmale](https://forum.networklessons.com/u/andysjunkmale)
#### Post date: [January 6, 2019, 4:07pm UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/6 "2019-01-06T16:07:53Z")

</div>

Nice explanation Rene’. Makes perfect sense.

One comment about the configs for R1. I don’t see the static default route in the config.

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [January 9, 2019, 3:14pm UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/7 "2019-01-09T15:14:10Z")

</div>

Hello Andy

Yes you are correct, I will let Rene know.

Thanks very much for catching that!

Laz

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [January 14, 2019, 4:25pm UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/8 "2019-01-14T16:25:34Z")

</div>

Thanks Andy, just fixed this.

---

<div class="post-metadata">

### Author: ![joseph](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/joseph/32/2869_2.png) [@joseph](https://forum.networklessons.com/u/joseph)
#### Post date: [May 23, 2020, 1:25pm UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/9 "2020-05-23T13:25:44Z")

</div>

Hi guys,

Great explanation, thank you.

Quick question,

What is the default nowadays in Cisco Routers “Classful or Classless”.

Also what command can I use to view what mode it is using?

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [May 26, 2020, 7:18am UTC](https://forum.networklessons.com/t/cisco-ip-classless-command/1273/10 "2020-05-26T07:18:01Z")

</div>

Hello Joseph

By default the classless feature is enabled. Before IOS version 11.3, the default was disabled. You can find out more info at this CLI command reference:

> **[Cisco IOS IP Addressing Services Command Reference - ip arp gratuitous...](https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr/command/ipaddr-cr-book/ipaddr-i1.html#wp2151028163)**
>
> ip arp gratuitous through ip dhcp ping packets

In order to see what mode you are in, you can take a look at the running configuration. If you see the `no ip classless` command exists, then you are running in classful mode. If the `ip classless` command exists **or if there is no such command at all** , then you are running in classless mode.

I hope this has been helpful!

Laz
