If you haven’t already, check out my previous post on Subnetting in Binary.
When studying for exams and just for everyday work, it’s important to be super quick when needing to subnet.
Thankfully, there are a few tricks to accomplish this.
Trick #1 The Easy Boundaries
There are four main bit boundaries that are dead giveaways.
Lets look at it in CIDR notation.
/8 = 255.0.0.0
/16 = 255.255.0.0
/24 = 255.255.255.0
/32 = 255.255.255.255
We know that if the range is between /9 and /15 we’re subnetting in the second octet. If the range is between /17 and /23 the third octet. Finally, if the range is between /25 and /31 the fourth octet.
Trick #2 The ‘in rule’
All subnet masks are continuous 1’s. A subnet mask is never discontinuous like 10100111.
Therefore if we have a mask of /17 we can determine right away from our previous trick that we’re only ‘1 in’ the octet. A /20 would be ‘4 in’ and a /23 would be ‘7 in’ or alternatively, ‘1 back’.
1 in or 7 back = 128 subnet size. Decimal notation is .128.
2 inĀ or 6 back = 64 subnet size. Decimal notation is .192.
3 in or 5 back = 32 subnet size. Decimal notation is .224.
4 in or 4 back = 16 subnet size. Decimal notation is .240.
5 in or 3 back = 8 subnet size. Decimal notation is .248.
6 in or 2 back = 4 subnet size. Decimal notation is .252.
7 in or 1 back = 2 subnet size. Decimal notation is .254.
8 in = The next octet. Doesn’t apply. Refer to Trick #1.
If you memorize the eight powers of two you’ll always know the correct subnet size.
Trick #3 Subtracting from 256
If we have a mask of /18 we know its equal to 255.192.0.0 in decimal notation. In this mask we only care about octets that are neither 255 or 0. So in this case its 192. To quickly find out the subnet size, we can just subtract 256 with 192! Which really quick equals 64 (our subnet size).
Trick #4 Wildcard masks
Here’s our mask /26. How do we find out the wildcard mask? Well first we convert it to dotted decimal notation. /26 equals 255.255.255.192
To get the wildcard mask all we do is simply subtract the DDN from 255.
255.255.255.255 255.255.255.192 - 000.000.000.063 <-- Wildcard Mask
Or an even faster way is to take the subnet size /26 equals a 64 and simply subtract 1 which still equals 63.
Last example: /19 is 255.255.224.0
224 equals a subnet size of 32 in the third octet.
Therefore our wildcard mask is 0.0.31.255