Open Source Software and Linux

Dec 21 2008   11:15PM GMT

Quick Subnetting and IP calculations Part 1

John Little Profile: Xjlittle

Lotus Domino

With all of the ip and subnetting calculators all over the internet it might seem to some that learning subnetting is unnecessary. I think that it is a skill that is underused and should be learned by all network administrators. It’s really not that hard to get the basics down.

In this article and the next I am going to show you how to do two things quickly and easily with subnetting. I’m going to show you how to build a custom subnet from scratch and how to calculate how many hosts on a network. The only part of the binary code of this that I’m going to discuss is this which we should all know:

128 64 32 16 8 4 2 1

The above numbers represent the 8 bits in a subnet mask.

To start building our custom subnet we are going to assume a class C network. With this we know that our default mask covers the first 24 bits which would make it Notice that 255 is the sum of all of the numbers above. Second let’s assume that our class C address in and that we want to build 6 subnets from this to cover six of our departments.

First convert the number of subnets to binary. We can see that adding bits 2 and 4 above make 6. We will turn all of the bits on that are to the right of the 4:


Next flip the entire octet from end to end:


Add the bits together that are on the left end of the bits shown in the 1st code box:


So now we know that 224 is our new subnet mask and that we can get 6 networks out of this. The 32 in this scenario is known as the Least Significant Bit or LSB. Pretty straightforward isn’t it?

Now we need to get our network, host and broadcast addresses. To do this take the Least Significant Bit from the three bits that we used above. This would be 32. So starting with 0 we start setting up our networks like so:

Network Address Range Broadcast
0 thru 30
32 thru 62
64 thru 94
96 thru 126

and so on. As you can see each network starts with 0 and then the LSB is the increment to the next network so we have 0 32 64 and so on. The broadcast address is 1 less than the next network number. This leaves the host addresses as the network number plus 1 through the broadcast address less 1 giving us 30 hosts per network

Next post we’ll see how to determine how many hosts on a network.


 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: