- Read the question. Know what network ID you are starting with and what your GOAL is: Do you need to obtain a certain number of subnets out of your original network or do you need to ensure a certain number of hosts are available in each subnet?
- Write your binary table on your paper. If you can multiply by two, you can do this
- Use one of two magic formulas to determine the number of bits that will be used in the new subnet mask
- 2n >= your desired number of subnets, where n is the number of new ones in the new subnet mask. The rest of the subnet mask will be composed of binary zeros.
- 2h-2 >= your desired number of hosts, where h is the number of zeros left in the new subnet mask. The rest of the subnet mask will be composed of binary ones.
- Or Skip the table and use this trick: 256 minus the last positive octet will also yield the block value of the networks
WORK THE EXAMPLE:
1. You have a Class C network, 188.8.131.52 that you want to subnet into 6 subnets.
2. We write down the all-important table:
3. 2n >= your Goal, therefore 23 = 8 >= 6 desired subnets.
4. A Class C subnet mask is 255.255.255.0, so if we add 3 ones, it will be 255.255.255.11100000 or 255.255.255.224 - that's 27 binary ones in the subnet mask, so our CIDR notation will be /27. (If you remember that a class C address starts as a CIDR /24 then you could just do /24+3 bits = /27)
5. We have five zeros in the subnet mask, so 25-2=30 hosts per subnet, and we have added 3 ones to the subnet mask, so 23=8 new subnets
6. Our increment is based on the least significant bit in the subnet mask, which in binary was 255.255.255.11100000. If we examine the last octet compared to our table we see that the last one is in the thirty-two column. (Also, 256-224=32)
That was 6 steps - so we should be done! Let's review:
- So, our network started as 184.108.40.206/24 (the /24 being CIDR notation for a 24-bit 255.255.255.0 subnet mask).
- Now we have a new subnet mask 255.255.255.224, CIDR notation /27
- Our first subnet ID is the same as the original network ID but with a new subnet mask: 220.127.116.11/27
- We determined our block value is by 32 in the fourth octet
- Therefore our second subnet would be: 18.104.22.168/27,
- Third: 22.214.171.124/27
- Fourth: 126.96.36.199/27
- Fifth: 188.8.131.52/27
- Sixth: 184.108.40.206/27
- Seventh: 220.127.116.11/27
- and finally Eighth: 18.104.22.168/27
- So there are the 8 subnets that each have 30 hosts per subnet, as expected!
Please note that if you count all of those subnets up, you have 8 of them. The amount we predicted back in step 3. Great job!
More subnetting examples and practice to come:
Keep practicing - here are some random subnetting question generators: