Subnetting Made Easy

LordFlasheartLordFlasheart Member Posts: 5 ■■■□□□□□□□
Hi all,

I've received an email from one of your members asking me to post up my technique for subnetting as links to external blogs are not allowed due to forum rules. I know that he benefited from it and he wishes to help out others so here goes:

First of all I need you to get rid of all of the negative thoughts surrounding subnetting. Put down all of the books that you have read about the subject and navigate away from other sites claiming to provide an easy way to subnet. This technique requires no charts, just simply the know-how to work with the powers of 2.

We need to start with the fundamentals of IP addressing. An IP address is made up of 32 bits, split into 4 octets (oct = 8, yes?). Some bits are reserved for identifying the network and the other bits are left to identify the host.

There are 3 main classes of IP address that we are concerned with.

Class A Range 0 - 127 in the first octet (0 and 127 are reserved)
Class B Range 128 - 191 in the first octet
Class C Range 192 - 223 in the first octet

Below shows you how, for each class, the address is split in terms of network (N) and host (H) portions.

NNNNNNNN . HHHHHHHH . HHHHHHHH . HHHHHHHH Class A
NNNNNNNN . NNNNNNNN . HHHHHHHH . HHHHHHHH Class B
NNNNNNNN . NNNNNNNN . NNNNNNNN . HHHHHHHH Class C

At each dot I like to think that there is a boundary, therefore there are boundaries after bits 8, 16, 24, and 32. This is an important concept to remember.

We will now look at typical questions that you may see on subnetting. More often than not they ask what a host range is for a specific address or which subnet a certain address is located on. I shall run through examples of each, for each class of IP address.

What subnet does 192.168.12.78/29 belong to?

You may wonder where to begin. Well to start with let's find the next boundary of this address.

Our mask is a /29. The next boundary is 32. So 32 - 29 = 3. Now 2^3 = 8 which gives us our block size i.e. 2 to the power of 3 equals 8.

We have borrowed from the last octet as the 29th bit is in the last octet. We start from zero and count up in our block size. Therefore it follows that the subnets are:-

192.168.12.0
192.168.12.8
192.168.12.16
192.168.12.24
192.168.12.32
192.168.12.40
192.168.12.48
192.168.12.56
192.168.12.64
192.168.12.72
192.168.12.80
.............etc

Our address is 192.168.12.78 so it must sit on the 192.168.12.72 subnet.

What subnet does 172.16.116.4/19 sit on?

Our mask is /19 and our next boundary is 24. Therefore 24 - 19 = 5. The block size is 2^5 = 32.

We have borrowed into the third octet as bit 19 is in the third octet so we count up our block size in that octet. The subnets are:-

172.16.0.0
172.16.32.0
172.16.64.0
172.16.96.0
172.16.128.0
172.16.160.0
.............etc

Our address is 172.16.116.4 so it must sit on the 172.16.96.0 subnet. Easy eh?

What subnet does 10.34.67.234/12 sit on?

Our mask is 12. Our next boundary is 16. Therefore 16 - 12 = 4. 2^4 = 16 which gives us our block size.

We have borrowed from the second octet as bit 12 sits in the second octet so we count up the block size in that octet. The subnets are:-

10.0.0.0
10.16.0.0
10.32.0.0
10.48.0.0
.............etc

Our address is 10.34.67.234 which must sit on the 10.32.0.0 subnet.

Hopefully the penny is starting to drop and you are slapping the side of your head realising that you were a fool to think that subnetting was hard. We will now change the type of question so that we have to give a particular host range of a subnet.

What is the valid host range of of the 4th subnet of 192.168.10.0/28?

Easy as pie! The block size is 16 since 32 - 28 = 4 and 2^4 = 16. We need to count up in the block size in the last octet as bit 28 is in the last octet.

192.168.10.0
192.168.10.16
192.168.10.32
192.168.10.48
192.168.10.64
.................etc

Therefore the 4th subnet is 192.168.10.48 and the host range must be 192.168.10.49 to 192.168.10.62, remembering that the subnet and broadcast address cannot be used.

What is the valid host range of the 1st subnet of 172.16.0.0/17?

/17 tells us that the block size is 2^(24-17) = 2^7 = 128. We are borrowing in the 3rd octet as bit 17 is in the 3rd octet. Our subnets are:-

172.16.0.0
172.16.128.0

The first subnet is 172.16.0.0 and the valid host range is 172.16.0.1 to 172.16.127.254. You must remember not to include the subnet address (172.16.0.0) and the broadcast address (172.16.127.255).

What is the valid host range of the 7th subnet of address 10.0.0.0/14?

The block size is 4, from 16 - 14 = 2 then 22 = 4. We are borrowing in the second octet so count in the block size from 0 seven times to get the seventh subnet.

The seventh subnet is 10.24.0.0. Our valid host range must be 10.24.0.1 to 10.27.255.254 again remembering not to include our subnet (10.24.0.0) and the broadcast address (10.27.255.255).

What if they give me the subnet mask in dotted decimal?

If you're lucky and they give you a mask in dotted decimal format then you should have an even easier time. All you need again is your block size.

Let's say they have given a mask of 255.255.255.248 and you wish to know the block size. Here's the technique:

1. Starting from the left of the mask find which is the first octet to NOT have 255 in it.
2. Subtract the number in that octet from 256 to get your block size e.g. above it is 256 - 248 = block size of 8.
3. Count up from zero in your block size in the octet identified in step 1 as you have learned above (the example above would be in the last octet).

Another example is a mask of 255.255.192.0 - you would simply count up in 256 - 192 = 64 in the third octet.

One more example is 255.224.0.0 - block size is 256 - 224 = 32 in the second octet.

What now?

Now it's time to go and pick up those books again and go straight to the practice questions, completely by-passing any of their techniques. Use my method and you will be laughing!

Happy subnetting!
«13456717

Comments

  • captobviouscaptobvious Member Posts: 648
    One word.......

    BRILLIANT!
  • kriscamaro68kriscamaro68 Member Posts: 1,186 ■■■■■■■□□□
    Ok so I got this question on subnettingquestions.com and didn't see a way to answer it with your method:
    Question: You are designing a subnet mask for the 10.0.0.0 network. You want 3800 subnets with up to 3800 hosts on each subnet. What subnet mask should you use?

    Answer: 255.255.240.0

    Here is also another one: Question: How many subnets and hosts per subnet can you get from the network 172.29.0.0 255.255.254.0?

    Answer: 128 subnets and 510 hosts

    Any way of explaining that out in your method. Thanks for that post I am finally starting to get subnetting.
  • dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Just memorize how many items you get for each number of bits (subtract two for hosts)

    000000000001 = 2 (1)
    000000000011 = 4 (2)
    000000000111 = 8 (3)
    000000001111 = 16 (4)
    000000011111 = 32 (5)
    000000111111 = 64 (6)
    000001111111 = 128 (7)
    000011111111 = 256 (8 )
    000111111111 = 512 (9)
    001111111111 = 1024 (10)
    011111111111 = 2048 (11)
    111111111111 = 4096 (12)

    If you can't remember what one is, just remember it's twice the number of the one before it (or halve the number after it if you're counting down). There's no math, tricks, etc. involved.

    So for the first question, you'll need 12 bits for both because the value is between 2048 and 4096 (you obviously have to go with the higher value).

    You can look at the other question the same way. /23 on a class B will give you 7 subnet bits and 9 host bits. 7 bits is 128 and 9 bits is 512 (minus 2 gives you 510).
  • kriscamaro68kriscamaro68 Member Posts: 1,186 ■■■■■■■□□□
    Thanks for the post dynamik I think it's all coming together for me now.
  • LordFlasheartLordFlasheart Member Posts: 5 ■■■□□□□□□□
    Ok so I got this question on subnettingquestions.com and didn't see a way to answer it with your method:
    Question: You are designing a subnet mask for the 10.0.0.0 network. You want 3800 subnets with up to 3800 hosts on each subnet. What subnet mask should you use?

    Answer: 255.255.240.0

    Here is also another one: Question: How many subnets and hosts per subnet can you get from the network 172.29.0.0 255.255.254.0?

    Answer: 128 subnets and 510 hosts

    Any way of explaining that out in your method. Thanks for that post I am finally starting to get subnetting.
    For your first question, how many bits do you need to borrow to accommodate 3800 subnets? The answer would be 12 bits as 2 ^ 12 = 4096. Your network address is a /8 by default as it is a Class A address so 8 + 12 = /20 mask.

    The second question is straightforward. Your address is Class B so it has a default mask of /16. 255.255.254.0 is the same as /23, so 23 - 16 = 7. 2 ^ 7 = 128 subnets and the number of hosts equals (2 ^ (32 - 23)) - 2 = 2 ^ 9 - 2 = 510 hosts.

    HTH
  • Morty3Morty3 Member Posts: 139
    Very much alike Jeremy from CBT nuggets way. Find the last 1 in the mask, that one is your increment. If the last one is a 8, the nets also hop with and 8.
    CCNA, CCNA:Sec, Net+, Sonicwall Admin (fwiw). Constantly getting into new stuff.
  • bryantstewartbryantstewart Member Posts: 31 ■■□□□□□□□□
    Great write up. This helped me out a lot.
  • kevin31kevin31 Member Posts: 154
    Great post Lordflasheart!

    I have been trying to subnet in my head for ages but there seems to be so many ways and guess Im just getting confused.

    I like the method behind lordflaheart does this work on all address classes? Is it really as simply as it seems?

    What do people thing of the chart method?

    thanks

    Kevin
    LAB - 4 X 2651XM's 1 X 2620 3 X 2950 1 X 2509 AS 1 X 3550
  • wbosherwbosher Member Posts: 422
    Get your hands on CBT Nuggets, this is by far the easiest method I've come accross. Using this method I can solve most subnetting problems in my head in less than 30 seconds. Give it a try. icon_thumright.gif
  • kevin31kevin31 Member Posts: 154
    Thanks wbosher I'll have a look see if I get it LOL
    LAB - 4 X 2651XM's 1 X 2620 3 X 2950 1 X 2509 AS 1 X 3550
  • Honky007Honky007 Member Posts: 26 ■□□□□□□□□□
    You are the man!!

    I thought I'd have to struggle with subnetting for weeks until I found this post.

    It really is awesome...and it works!

    I practised with this for an afternoon and now there's no subnetting question on subnettingquestions.com - Free Subnetting Questions and Answers Randomly Generated Online that I can't get within about 30 seconds...and it's getting easier.

    Can't thank you enough...

    :):):)
  • MattGibsonMattGibson Member Posts: 36 ■■□□□□□□□□
    Got a subnetting question that I couldn't figure out.

    What is the first valid host on the subnetwork that the node 172.26.224.246/20 belongs to?

    Answer -
    172.26.224.1

    Here was my logic using the system

    24 - 20 = 4 and 2^4 = 16

    I counted up and here's what I got:

    0
    16
    32
    48
    64
    80
    96
    112
    128
    144
    160
    186
    202
    218
    234
    250

    So I figured the first host on the subnetwork would be 172.26.218.1
    Considering that 224 falls inbetween 218 and 234.

    Where was I wrong?
    Currently focusing on my 70-291
    Just getting started!
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    MattGibson wrote: »
    Got a subnetting question that I couldn't figure out.

    Where was I wrong?

    Right here:

    160
    186
    202
    218
    234
    250

    You went up by 26 instead of 16, putting the rest of your numbers 10 ahead. Subtract 10 from each number after 160, and you'll see that 224 is a subnet boundary, making 224.1 the correct choice.

    When you're doing this method, the last possible number on the octet is 256, if your last application of the range will put you over that, you made an error in incrementing, it's a good way to double check yourself. You should be able to go from 0 to 256 just by incrementing by your range and never going over.

    My personal rule of thumb is that, if I'm going to have to count the increment more than 5 steps, I'll just **** and use division instead. Once you know the range, it's pretty easy to find any subnet boundary.

    For the question they asked, you know the range is incrementing on the third octet, so take that number and divide it by your range. Drop any remainder/fraction, and then multiply the result by your range.

    224 / 16 = 14. 14 * 16 = 224

    Seems a bit obvious, but let's say they'd given you the 172.26.243.246/20 and asked for the first valid host in the subnet.

    243 / 16 = 15.1875, drop the fraction, 15 * 16 = 240, 172.26.240.1 would be the first valid IP for the subnet that IP resides on.
  • mikej412mikej412 Member Posts: 10,086 ■■■■■■■■■■
    mattgibson wrote: »
    160
    186
    202
    218
    234
    250

    so i figured the first host on the subnetwork would be 172.26.218.1
    considering that 224 falls inbetween 218 and 234.

    Where was i wrong?
    160+16=176
    176+16=192
    192+16=208
    208+16=224
    224+16=240
    240+16=256
    :mike: Cisco Certifications -- Collect the Entire Set!
  • londo29londo29 Member Posts: 1 ■□□□□□□□□□
    144
    160
    186
    You added incorrectly. after 160 the next number is 176 not 186
    160
    176
    192
    208
    224
  • MattGibsonMattGibson Member Posts: 36 ■■□□□□□□□□
    Thanks for the help guys. I figured it was that, but for some reason I wasn't seeing it. Good to know the error wasn't in the logic!
    Currently focusing on my 70-291
    Just getting started!
  • alexander007alexander007 Member Posts: 6 ■□□□□□□□□□
    What if they told to do this?

    Given the Class C network of 204.15.5.0/24, subnet the network in order to create the network in Figure 3
    with the host requirements shown.
    Figure 3

    subl.png

    Thanks for the help
  • miller811miller811 Member Posts: 897
    When presented with a problem like this, sort the networks largest to smallest and then start subnetting

    Subnet - Range - hosts
    b. 204.15.5.0/27 - 204.15.5.0 - 204.15.5.31 - 30 hosts
    e. 204.15.5.32/27 - 204.15.5.32 - 204.15.5.63 - 30 hosts
    a. 204.15.5.64/28 - 204.15.5.64 - 204.15.5.79 - 14 hosts
    d. 204.15.5.80/28 - 204.15.5.80 - 204.15.5.95 - 14 hosts
    c. 204.15.5.96/30 - 204.15.5.96 - 204.15.5.99 - 2 hosts
    I don't claim to be an expert, but I sure would like to become one someday.

    Quest for 11K pages read in 2011
    Page Count total to date - 1283
  • alexander007alexander007 Member Posts: 6 ■□□□□□□□□□
    but how do you get that answer?....I need to see how to answer that...not just tha answer

    Thanks again
  • blackninjablackninja Member Posts: 385
    but how do you get that answer?....I need to see how to answer that...not just tha answer

    Thanks again

    You need to learn VLSM, check out: Click here!
    Currently studying:
    CCIE R&S - using INE workbooks & videos

    Currently reading:
    Everything. Twice ;)
  • miller811miller811 Member Posts: 897
    but how do you get that answer?....I need to see how to answer that...not just tha answer

    Thanks again

    Do you know how to subnet?
    You need to know how to subnet to solve the problem.

    The IP scheme that they gave you was a single subnet with 254 host possible.

    You need to then break it up into smaller subnets by subnetting......

    204.15.5.0 /24
    could be broken into two segments of 128 bits by changing the mask to a /25 = 126 usable hosts per subnet
    204.15.5.0 /25 204.15.5.0 - 204.15.5.127
    204.15.5.128/25 204.15.128-204.15.5.255

    it could also be broken into 4 subnets by starting out with a /26 mask = 62 usable host/subnet
    204.15.5.0 /26 204.15.5.0-204.15.5.63
    204.15.5.64/26 204.15.5.64-204.15.5.127
    204.15.5.128/26 204.15.5.128 - 204.15.5.191
    204.15.5.192/27 204.15.5.192-204.15.5.255

    it could also be broken into 8 subnets with a /27 mask = 30 usable hosts/subnet
    204.15.5.0 /27
    204.15.5.32/27
    204.15.5.64/27
    204.15.5.96/27
    204.15.5.128/27
    204.15.5.160/27
    204.15.5.192/27
    204.15.5.224/27

    it could also be broken into 16 subnets with a /28 mask = 14 usable hosts
    it could also be broken into 32 subnets with a /29 mask = 6 usable hosts
    it could also be broken into 64 subnets with a /30 mask = 2 usable hosts

    So you take the highest number of host you need per subnet first, 2 of the networks required 28 hosts, so the first 2 subnets would be /27

    204.15.5.0 /27
    204.15.5.32/27

    since the second subnet extends to 204.15.5.63, the starting point for the next subnet would be 204.15.5.64

    The next subnet requires 14 hosts, we would use a /28 mask

    so 204.15.5.64 /28 = 204.15.5.64-204.15.5-79

    the next subnet requires 7 hosts, so we would need to use a /28 mask again
    so we would start with the next IP
    204.15.5.80 /28 = 204.15.5.80 - 204.15.5.95

    the last subnet only requires 2 IP address so we would use a /30 mask
    the next IP address is
    204.15.5.96 /30 = 204.15.5.96 - 204.15.5.99

    Hope that helps
    I don't claim to be an expert, but I sure would like to become one someday.

    Quest for 11K pages read in 2011
    Page Count total to date - 1283
  • alexander007alexander007 Member Posts: 6 ■□□□□□□□□□
    I see now..Thanks
  • unitedfan1unitedfan1 Member Posts: 1 ■□□□□□□□□□
    Hi guys, kinda new at all of this....i`m currently doing CCNA1 and i have a question i was hoping you could help me out with.

    Question : ABC has aquired a class B address 172.16.0.0 ,the Company needs to create a subnetting scheme to provide the following:

    36 subnets with at least 100 hosts
    24 " " " " " " " " 255 hosts
    10 " " " " " " " " 50 hosts

    NB : It is not necessary to create a WAN connection

    a)How many subnets are needed for this network
    b)What is the minimum number of bits that can be borrowed
    c)What is the subnetmask for this network in dotted decimal, binary and slash format
    d)How many usable subnets are there
    e)How many usable hosts are there per subnet

    I know its a bit long but it would be great if you guys were to walk me through this one

    thank you
  • mella060mella060 Member Posts: 198 ■■■□□□□□□□
    VLSM is basically subnetting a subnet. You have to be able to subnet first. Once you have mastered subnetting then working out VLSM issues will be a lot easier.
  • thenjdukethenjduke Member Posts: 894 ■■■■□□□□□□
    Wow this concept is so much easier then any video or book I have read. I actually like this.
    CCNA, MCP, MCSA, MCSE, MCDST, MCITP Enterprise Administrator, Working towards Networking BS. CCNP is Next.
  • gozilagozila Member Posts: 1 ■□□□□□□□□□
    Hi folks,

    I have two questions :


    1) How can I count the next boundary?

    Quote:
    Originally Posted by kriscamaro68 viewpost.gif
    Ok so I got this question on subnettingquestions.com and didn't see a way to answer it with your method:
    Question: You are designing a subnet mask for the 10.0.0.0 network. You want 3800 subnets with up to 3800 hosts on each subnet. What subnet mask should you use?

    Answer: 255.255.240.0


    For your first question, how many bits do you need to borrow to accommodate 3800 subnets? The answer would be 12 bits as 2 ^ 12 = 4096. Your network address is a /8 by default as it is a Class A address so 8 + 12 = /20 mask.

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!?
    2) may you explain It more by detail?


    My regards
  • miller811miller811 Member Posts: 897
    gozila wrote: »
    Hi folks,

    I have two questions :


    1) How can I count the next boundary?




    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!?
    2) may you explain It more by detail?


    My regards

    Read the very post in the string... should be all you need
    I don't claim to be an expert, but I sure would like to become one someday.

    Quest for 11K pages read in 2011
    Page Count total to date - 1283
  • LAN_ManLAN_Man Member Posts: 31 ■■□□□□□□□□
    Thanks everyone for the great post. It helps alot.
  • rumblebee1217rumblebee1217 Member Posts: 1 ■□□□□□□□□□
    Thanks for the post, it helped out a lot. Though I still find myself struggling on class a & b. Guess more practice will help.
  • SatcomSatcom Member Posts: 110
    thanks for the write up I hate to even think about sub-netting when I think about study. I would rather learn how routing protocols work and how routers talk to each other than subnet. Back to the books icon_study.gif

    bookmarked this thread for future reference going to get heavy on subnetting!
Sign In or Register to comment.