# Subnetting Made Easy

LordFlasheart
Posts:

**5**Registered Members ■□□□□□□□□□
in CCNA / CCENT

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.

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.

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.

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?

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.

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.

/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).

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).

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.

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!

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!

0

## Comments

648Registered MembersBRILLIANT!

CCNA:S

Don't be a dumper!

1,184Registered Members ■■■■■■■□□□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.

12,314Banned000000000001 = 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).

1,184Registered Members ■■■■■■■□□□5Registered Members ■□□□□□□□□□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

139Registered Members31Registered Members ■■□□□□□□□□154Registered MembersI 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

422Registered Members154Registered Members26Registered Members ■□□□□□□□□□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...

:):)

36Registered Members ■■□□□□□□□□What is the first valid host on the subnetwork that the node 172.26.224.246/20 belongs to?

172.26.224.1Answer -

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?

Just getting started!

4,024Registered MembersRight here:

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 cheat 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.

10,090Registered Members176+16=192

192+16=208

208+16=

224224+16=240

240+16=256

1Registered Members ■□□□□□□□□□160

186

You added incorrectly. after 160 the next number is 176 not 186

160

176

192

208

224

36Registered Members ■■□□□□□□□□Just getting started!

6Registered Members ■□□□□□□□□□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

Thanks for the help

897Registered MembersSubnet - 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

Quest for 11K pages read in 2011

Page Count total to date - 1283

6Registered Members ■□□□□□□□□□Thanks again

385Registered MembersYou need to learn VLSM, check out: Click here!

CCIE R&S - using INE workbooks & videos

Currently reading:

Everything. Twice

897Registered MembersDo 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

Quest for 11K pages read in 2011

Page Count total to date - 1283

6Registered Members ■□□□□□□□□□1Registered Members ■□□□□□□□□□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

196Registered Members894Registered Members1Registered Members ■□□□□□□□□□I have two questions :

1) How can I count the next boundary?

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!?

2) may you explain It more by detail?

My regards

897Registered MembersRead the very post in the string... should be all you need

Quest for 11K pages read in 2011

Page Count total to date - 1283

31Registered Members ■■□□□□□□□□1Registered Members ■□□□□□□□□□110Registered Membersbookmarked this thread for future reference going to get heavy on subnetting!