您的位置:首页 > 其它

Calculating the Range of Addresses on Your Network

2009-11-28 00:51 441 查看
If someone gives you an IP address of 97.158.253.28 and a subnet
mask of 255.255.255.248, how do you determine the network address and
the broadcast address, in other words the boundaries, of your network?
The following section outlines the steps to do this using both a manual
and programmed methodology.

Manual Calculation

Take out your pencil and paper, manual calculation can be tricky. Here we go!

Subtract the last octet of the subnet mask from 256 to give the number of IP addresses in the subnet. (256 - 248) = 8

Divide the last octet of the IP address by the result of step
1; don't bother with the remainder (for example 28 / 8 = 3). This gives
you the theoretical number of subnets of the same size that are below
this IP address.

Multiply this result by the result of step 1 to get the
network address (8 x 3 = 24). Think of it as the third subnet with 8
addresses in it. The network address is therefore 97.158.253.24

The broadcast address is the result of step 3 plus the result
of step 1 minus 1. (24 + 8 -1 = 31). Think of it as the broadcast
address being the network address plus the number of IP addresses in
the subnet minus 1". The broadcast address is 97.158.253.31

Let's do this for 192.168.3.56 with a mask of 255.255.255.224:

256 - 224 = 32

56/32 = 1

32 x 1 = 32. Therefore the network base address is 192.168.3.32

32 + 32 - 1 = 63. Therefore the broadcast address is 192.168.3.63

Let's do this for 10.0.0.75 with a mask of 255.255.255.240

256 - 240 = 16

75/16 = 4

16 x 4 = 64. Therefore the network base address is 10.0.0.64

64 + 16 -1 = 79. Therefore the broadcast address is 10.0.0.79

Note:
As a rule of thumb, the last octet of your network base
address must be divisible by the "256 minus the last octet of your
subnet mask" and leave no remainder. If you are sub-netting a large
chunk of IP addresses it's always a good idea to lay it out on a
spreadsheet to make sure there are no overlapping subnets. Once again,
this calculation exercise only works with subnet masks that start with
"255.255.255".
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐