TechKnowSurge
CompTIA Network+ 1.7 Cisco CCNA 1.6 Cisco CCST Networking 2.2 CompTIA A+ Core 1 2.6
VideoNetworkFree

DEMO: Custom Subnet Masks

Custom subnet masks and CIDR notation are calculated by identifying a address's default classful network bits and adding any borrowed bits to determine both the slash notation and the corresponding subnet mask value.

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

About this video

Custom subnet masks extend the default classful addressing structure by borrowing additional bits from the host portion of an IP address. The process begins by identifying the address class from the first octet, which establishes the baseline number of network bits — 16 for Class B and 24 for Class C. Adding the borrowed bits to that baseline produces the CIDR prefix length, expressed in slash notation such as /24 or /28. Converting a CIDR prefix to a subnet mask follows directly from that prefix length. Fully occupied octets always produce a value of 255, while any partially borrowed octet is resolved using the standard bit-value table, where four borrowed bits yield 240. Practicing these conversions across multiple address examples builds the fluency needed to work accurately with subnetting in real network environments.

What you'll learn

What's covered

Custom Subnet Masks

Aligned to

CompTIA Network+
1.7 Given a scenario, use appropriate IPv4 network addressing.
Cisco CCNA
1.6 Configure and verify IPv4 addressing and subnetting.
Cisco CCST Networking
2.2 Identify IPv4 addresses and subnet formats.
CompTIA A+ Core 1
2.6 Compare and contrast common network configuration concepts.

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.
Classless Inter-Domain Routing
CIDR
A method for allocating IP addresses and expressing routing prefixes that replaces the older classful addressing scheme by using variable-length prefix notation (e.g., /24). CIDR enables more efficient use of IPv4 address space and reduces the size of internet routing tables through route aggregation.
Bit Borrowing
The practice of taking bits from the host portion of a classful default subnet mask to create additional network subdivisions, extending the prefix length.
Classful Addressing
An early IPv4 addressing scheme that divided the address space into fixed classes (A, B, and C for hosts; D for multicast; E reserved) based on the leading bits of the address, with each class defining a fixed boundary between the network and host portions. Classful addressing was replaced by CIDR because it wasted large blocks of address space.

Transcript

In this exercise we're going to figure out what the CIDR notation is and what the custom subnet mask is for these addresses. We've got two pieces of information here: the address, and the number of bits that we're borrowing. I've also created this little cheat sheet over here on the left hand side that we can use to calculate things easily.

The first address

In this example right here we've got this address. I can see from the first octet this is a Class B. A Class B means that the network bits are the first two octets, so those are the network bits, and we're borrowing another eight, so we're borrowing another octet. If I count that all up, we have a total of 24 bits: we have 16 from the default mask here, or the classful address range here, plus 8 is 24. So we're going to say that the CIDR notation for this is a slash 24.

So we've got the CIDR notation; now we need to figure out what the custom subnet mask is. This one's going to be fairly easy. We start out with the default subnet mask, which is 255.255, and then we add to it how much we're borrowing here. We're borrowing a whole eight bits, and eight bits is 255, so that's pretty easy to figure out. So 255.0.

The second address

Let's do the next one too. We've got 205, so I know because of the 205 this is a Class C. A Class C has a total of 24 bits that we already have, and we're borrowing four more, so 24 plus 4 is 28, so we have a slash 28. The default subnet mask is 255.255.255, so we have at least that, and then we're borrowing four bits here. I'm going to take a look at my little cheat sheet over here, and it's going to be a 240. So the last here is a 240, and that is the custom subnet mask.

Go ahead at this point and go through the rest of these, and once you're finished, check your work and make sure you did everything accurately. Hopefully you've got that down. Once again, this is pretty critical, so make sure that you have this down well. Don't proceed until you can do this accurately, and if you need to practice more, go ahead and practice more.

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 →