TechKnowSurge
Cisco CCNA 1.6 CompTIA Network+ 1.7 Cisco CCST Networking 2.2 Cisco CCNA 1.7
VideoNetworkFree

DEMO: VLSM Example C-1

Variable Length Subnet Masking (VLSM) allows a single IP address block to be divided into subnets of different sizes, allocating addresses efficiently based on each network's actual host requirements. This example walks through subnetting a Class C address across five networks with varying host counts.

Complete this video to capture a CTF flag worth 1 point.

About this video

VLSM is a subnetting technique that allows different subnet masks to be applied within the same network, making it possible to allocate address space according to the actual size of each segment rather than forcing all subnets to be the same size. This approach is essential in real-world network design, where some segments may need to support hundreds of hosts while point-to-point router links require only two usable addresses. By tailoring each subnet to its specific host requirement, VLSM significantly reduces address waste compared to classful or fixed-length subnetting methods. The process always begins with the largest host requirement and works downward. Using a Class C block with a default /24 mask, the first subnet is sized to hold 102 hosts, which requires borrowing enough bits to provide at least 128 addresses, yielding the range .0 through .127. The next subnet accommodates 60 hosts and is assigned the range .128 through .191. The three remaining two-host networks are then carved from the leftover space, occupying .192–.195, .196–.199, and .200–.203 respectively — each a /30 providing exactly two usable addresses. The validity of the design is confirmed by checking that all assigned ranges are contiguous and non-overlapping, covering .0 through .203 without any gaps or conflicts. This sequential, largest-first allocation strategy is the standard method for VLSM planning and ensures that the remaining address space stays organized and available for future subnets. The result is a clean, efficient addressing scheme that meets every network's requirements while conserving the overall address block.

What you'll learn

What's covered

VLSM Example

Aligned to

Cisco CCNA
1.6 Configure and verify IPv4 addressing and subnetting
1.7 Describe private IPv4 addressing
CompTIA Network+
1.7 Given a scenario, use appropriate IPv4 network addressing
Cisco CCST Networking
2.2 Identify IPv4 addresses and subnet formats

Key terms

Subnet
A logical subdivision of an IP network, used to organize and segment network traffic.
Subnet Mask
A 32-bit number that divides an IP address into network and host portions.
IP Address
A numerical label assigned to each device connected to a network that uses the Internet Protocol.
Variable Length Subnet Mask
VLSM
A subnetting technique that allows a network administrator to divide an address space into subnets of different sizes by using different prefix lengths, allocating address space more efficiently than fixed-length subnetting. VLSM requires a classless routing protocol such as OSPF, EIGRP, or RIPv2 that carries prefix length information in routing updates.
Network Address
The first address in an IP network range that identifies the network itself and cannot be assigned to a host. It is formed when all host bits are set to zero.
Broadcast Address
The last address in an IP subnet range, formed when all host bits are set to one, used to send a single packet to every device on that network simultaneously.

Transcript

The Requirements

Let's go over an example of VLSM and talk through the steps of how to do variable length subnet masking.

In this example we're going to be working with a Class C address. I know it's a Class C because it's the 192, so that is a Class C, which is a /24 by default, so we have a 255.255.255.0 default subnet mask.

I'm going to be subnetting this, but I'm going to do variable length subnet masking. I have five networks that I need to plan for. The first one has 102 hosts in it. The second one has 60 hosts in it. And then I have three networks that have just two hosts, which is actually not uncommon, because if you have a router with just the link, then often you would have a need for just two different IP addresses there.

The First Network

So how are we going to subnet this? First of all, we require 102 addresses for this first network, so if I were to go through and find how many we need, it would be this network right here. We borrow one bit for this.

So the first network is, we're going to divide and put the line right here — that's where the line is going to be. I'm going to say that this is going to start with 0, so I'm going to put a 0 in there. Now the first network address of this is going to be all zeros, so I can put that in there: the network address for this is .0. Then I can do all ones for this, which, if I were to add that up, 64 plus 32 plus 16 plus 8 plus 4 plus 2 plus 1, is .127, and that's the broadcast address for that. So the usable host range for that is going to be anywhere from .1 through .126. That's the usable range.

We've used up that whole range, so no other addresses can have a zero at the beginning of this, because we've used up all of the addresses there.

The Second Network

So the next address has to start with a one. If you have multiple networks like this, usually it's easiest to start with the largest network first, so that's why we're starting with this 102. Now we're going down to the 60.

Let's see what that looks like. I'll remove some of my marks here and we're going to do it all over again. For this we need 60 addresses, so I'll go up to where we can fit 60 in there, which is right there, so this is where I'm going to draw the line. I'm going to call this a one zero for the network, because that would be the next logical step there.

If I had all zeros for the host bits, then I would have .128 right there. If I had all ones for the host bits — so switch these all to ones here — I'd add up 128 plus 32, 16, 8, 4, 2 and 1, and that would come up with 191. So my usable range for that is 129 through .190.

The Three Two-Host Networks

I'm going to delete some of my markings here. The next thing we need to do is for these little twos right here, which we can meet with drawing a line right here.

I've already used up all of the zeros here — I've used up the whole range right here. I have used up the range of all of the one zero, so this took up that whole range there. So the next one has to be one one; I don't have any other options.

I've got one one, and I'm going to add zeros across here, and that's my first network. So for the network address I'll put two zeros here: the next address is .192. If I were to change these to ones — so I'm going to switch these out and put ones there — then it's 192 plus 2 is 194, plus one is 195. So my usable range here is .193 to .194, just two addresses, which is what I was planning for. There is that next network, that's my third network.

Next, what I need to do is add one to this binary number to come up with that right there, so this next network is .196. If I were to put ones in here, then that would be .199, is what the total adds up to there. So my usable address range is 197 through .198.

I've got that now taken care of. Now my next network address that I can use is one one zero zero one zero. If I were to put 0 0 in here, this would equate to .200, and then the last of this range, I'm going to put ones in here, would be .203. So my usable range is .201 to .202, just two addresses.

Checking the Result

There you have it — now I've met all of the needs using variable length subnet masks. Notice that now it all makes sense from a sequence standpoint. I've got from .0 through .127, and then I've got 128 through 191, 192 through 195, 196 through 199, and 200 to .203. So all those ranges make sense. There's nothing that's overlapping. I wouldn't want anything to overlap here; I can't have the same IP address in two different spots, so that wouldn't make sense. Nothing is overlapping and everything works out.

So that is the answer to this problem right here, and we just variable length subnet masked this network right here.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →