Subnetting Class C Networks and VLSM Tutorial

In this Cisco CCNA training tutorial, you’ll learn how to subnet Class C networks and how Variable Length Subnet Masking or VLSM works. Scroll down for the video and also text tutorial.

Subnetting Class C Networks and VLSM Video Tutorial

YouTube video


Jack Zinkiewicz

Jack Zinkiewicz

My team had an opening due to a retirement which gave me a short window of time to get up to speed with my peers, about 110 days.  I used Neil’s video instruction to get the baseline knowledge and all of the CCNA support tools on to get good at labs.

All of Neil’s resources + the Cisco book + bootcamp enabled me to pass CCNA and CCNP in less than 4 months.

Jack Zinkiewicz

Class C /31 Subnet


Let's say that we've been allocated the Class C network We're going to move the line all the way to the right and we're going to go with a /31.


Obviously, we can't do a /32 if we want to have more than one available host. You can use a /32 subnet for a single host which is mostly used for loopback addresses.


If we wrote that subnet mask in dotted decimal notation, it would be We get the 254 because it's 128 plus 64, 32, 16, 8, 4 plus 2 comes up to 254. That leaves one bit for the host address, which has a possible value of a one or a zero.


Class C /31 Subnet


Class C /31 borrows 7 bits for the network address from the host address. That gives us 128 subnets, which is 2 to the power of 7. /31 can accommodate two hosts each.


The valid host addresses would be to, to, to, all the way up to and We're using, the first three octets are never going to change. In the last octet, you just start with all zeros. Then, it would be 0000001 and zero and one, 0000010 and zero and one, etc.


Class C /31 Subnet 1


But wait, if we're using a /31, there are only two possible values to assign to the host. What about the network and broadcast address?


/31 subnet breaks the standard rules of IP addressing where we have to have the network address and the broadcast address. /31 subnets are supported on Cisco routers for point-to-point links.


If you think about it, a point-to-point link is for just one side and the other side. Any traffic that comes from this side needs to go out on the other side and vice versa. The traffic has nowhere else to go, therefore, there’s no point in having a network and a broadcast address. Hence, Cisco allowed that exception.


Class C /31 Subnet 2


Class C /30 Subnet


Next up, we're going to create a /30. The subnet mask in dotted decimal is and it will be going to leave 2 bits for the host address.


That is 2 to the power of 2 is 4, minus 2 for the network and the broadcast address, and that gives us 2 possible hosts. It borrows 6 bits for the network address and it can accommodate 2 hosts each.


Class C /30 Subnet


On the first subnet, the network address is and the broadcast address is The valid addresses are and The next subnet has the network and the broadcast is The valid range would be to


In the next subnet, the network would be, the valid addresses would be and, and the broadcast would be, and so on.


As you look at this, you can calculate what the different valid subnets are going to be by noticing where the line is. It's after number 4, so the network address is going to go up in values of 4. The first network address is, next would be network address The next network address is,,, etc.


Class C /30 Subnet 1


We know the network addresses therefore, we can work out what the broadcast and the range of valid IP addresses are going to be. In our example, it's going up in values of 4.


The first subnet is going to be a zero. is the network address and because the next range starts at, the broadcast address must be


If is the network address, and is the broadcast address, the valid host addresses must be and The next subnet starts at


The next subnet after that is, so the broadcast address must be The network address of and broadcast address of leaves the addresses in between and which are available to be assigned to our hosts.


/31 vs /30


/31 and /30 both supported two hosts per subnet. But a /31 supports 128 subnetworks and a /30 only supports 64 subnets. You're maybe thinking, "Oh well we're always going to use /31 then." A /31 is useful if you need to maximize the use of your address space, but a /30 is more commonly used. It's more standardized.


For the CCNA exam, if you get a question where you've got to choose whether you would use either a /31 or a /30, always use a /30. If the question requires you to come up with a subnet that supports 2 hosts, use a /30 unless the question explicitly tells you to use a /31.


/31 vs /30


Class C /29 Subnet


Next up is a /29, we're going to move the line back a space again. A /29 in dotted decimal is Again, we got the 248 because it's 128, plus 64, plus 32, plus 16, plus 8, up to where the line is.


That leaves 3 bits for the host address. 2 to the power of 3 is 8 minus 2 for the network address and the broadcast address will give us 6 available host addresses. The default subnet mask for Class C is /24.


Here, we're using a /29 so we're borrowing 5 bits for the network address. 2 to the power of 5 is 32 so, we've got 32 available subnets here.


Class C /29 Subnet


Notice that the line is after the 8, therefore, the network addresses are going to go up in values of 8. The first one will be, then, then, and so on.


In the first subnet, the network address is The next subnet the network address is, so the broadcast address for the first subnet must be one less, which is If the network address is and the broadcast address is, that leaves to available addresses to be assigned for our hosts.


Class C /29 Subnet 1


The next subnet starts with, and the following subnet is at Our broadcast address now must be, which leaves the available host addresses of to We can go on up to network address and broadcast address, with host addresses to


Other Class C Subnet Masks


We can carry on moving the line back a place. We did /31, /30, /29. We could also do a /28, which is It will give us 16 networks of 14 hosts each on a Class C. Again, the default is a /24.


If we are using a /28 we've borrowed 4 bits and 16 available subnets. We've also got 4 bits available for our host addressing. That is 2 raised to the power of 4 equals 16 minus 2, for the network and broadcast addresses, and it gives us 14 usable hosts.


Other Class C Subnet Masks


We can move the line back again to a /27. That's going to be borrowing 3 bits. So that is 8 available networks. Leaving 5 bits available for our hosts, which will be 32 minus 2, gives us 30 available hosts.


A /26 is 4 networks and 62 hosts. A /25 is 2 networks and 126 hosts. /24 is the default 1 network with 254 hosts. That's how we carry out subnetting and figure out how many networks, and how many hosts we're going to have.


Variable Length Subnet Masks VLSM


The next thing to tell you about is Variable Length Subnet Masks. With early routing protocols, like RIP version 1, they only supported fixed-length subnet masks. It means that you could perform subnetting but all subnets in a particular network had to be the same size.


All of your different subnets had to accommodate 14 hosts, for example, or 30 hosts for example. If you had one subnet that needed up to 30 hosts, you have to allot all your subnets a size of 30 hosts even if only one of them had 3 hosts in it.


Variable Length Subnet Masks VLSM


With later routing protocols, they came out with support for Variable Length Subnet Masks. That means that within the same range you can have different sizes of subnets in there.


Let’s say, I've got one part of my network which has got 10 hosts in it. I could give them 14 available hosts and another part of the network that's got 28 hosts there. I could give them a subnet mask that gives them 30 available hosts.


Variable Length Subnet Masking means we can use different length subnet masks within the same network. This is a good thing because it lets us be much more precise with the size of our networks and we're going to be wasting a lot fewer addresses.


Additional Resources


Cisco Networking Basics: IP Addressing:

Constructing an IP Network Addressing Scheme:

Cisco CCENT Practice and Study Guide: Subnetting IP Networks:

Subnetting Practice Questions:


Want to practice Cisco CCNA technologies on your laptop? Download my complete 350-page Cisco CCNA Lab Guide for free.


Click Here to get my Cisco CCNA Gold Bootcamp, the highest rated CCNA course online with a 4.8 star rating from over 20,000 public reviews.


Libby Teofilo

Text by Libby Teofilo, Technical Writer at

With a mission to spread network awareness through writing, Libby consistently immerses herself into the unrelenting process of knowledge acquisition and dissemination. If not engrossed in technology, you might see her with a book in one hand and a coffee in the other.