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.
Custom Subnet Masks
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.
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.
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.
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 →