Subnet Mask archives - Open Source Software and Linux

Open Source Software and Linux:

subnet mask

Dec 25 2008   4:55AM GMT

Quick Subnetting and IP calculations Part 2



Posted by: John Little
subnet mask, subnetting, ip calculator, network hosts

In my last post I discussed how to make quick subnetting and IP calculations. This post is will help us determine how many hosts on a network.

Suppose that you know your IP address and an abbreviated notation subnet mask. What you need to find out is the IP of your default gateway.

The address that you are given is 192.168.200.120/26. The last assignable IP is your gateway. Before we get started a quick note about abbreviated subnet masks. You can determine the standard subnet mask by dividing the abbreviated notation by 8 and using the remainder to add together that number of bits starting from the leftmost bit in a subnet mask. In our case 8 will go into 26 three times with two left over. Adding together the two leftmost bits in a subnet mask, 128+64 gives us 192. So our standard subnet mask is 255.255.255.192.

To start solving our gateway problem we first the 192 into bit values which = 11000000.

The smallest bit is 64 so our subnets are incremented by 64. Recall from the previous post how we laid this out:

Network Address Range
0 192.168.200.1 through 63
64 192.168.200.65 through 127
128 192.168.200.129 through 191
192 192.168.200.193 through 255

As we can see from above our machine falls into the second address range with an IP of 192.168.200.120. The first addressable IP is 192.168.200.65 and the broadcast address is 192.168.200.127. Remember that the broadcast address for a network is the last IP shown for that range. This makes the default gateway one less than the broadcast address giving us 192.168.200.126 for the gateway. There are 62 host IP address available on your network segment after taking out the network and broadcast IP.

So there it is. You have now found your default gateway and know how many hosts are on your network segment and what their IP addresses are.

-j

Dec 21 2008   11:15PM GMT

Quick Subnetting and IP calculations Part 1



Posted by: John Little
subnet mask, ip addressing, ip address, subnetting, calculate subnet

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 255.255.255.0. Notice that 255 is the sum of all of the numbers above. Second let’s assume that our class C address in 192.168.10.0 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:

00000111

Next flip the entire octet from end to end:

11100000

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

128+64+32=224

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 192.16.10.1 thru 30 192.168.10.31
32 192.16.10.33 thru 62 192.168.10.63
64 192.16.10.65 thru 94 192.168.10.95
96 192.16.10.97 thru 126 192.168.10.127
128
160
192
224

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.

-j