# more subnetting

I'm trying to figure out without a subnet calc how to get a subnet mask when given a range of ip addresses

Example: 125.138.0.0 - 125.159.255.255
118.67.128.0 - 118.67.191.255
There has to be some method to this.  Can someone help me out.
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Enterprise ArchitectCommented:
That info would not be sufficient necessarily on its own as you have not dictated how many subnets would be required from that range or how many hosts were needed in each subnet.

For example, the obvious subnet mask for your second example would be 255.255.192.0 if this were to be all one subnet but.....
0
Author Commented:
OK that's all the info I got.
0
Enterprise ArchitectCommented:
ok....

the long and short of it is simply experience and practice.

I got to the mask I gave is as follows:

the first two octects of the start and end address are the same - 118.67 so the first 16 bits - 8 in each are matched the same so this equates to 255.255. - 128+64+32+16+8+4+2+1 = the 8 bits in the octet.

The third octet is different and has 64 making up the difference : 128 - 192 so 256 (.0 - .255) / 64 = 4.
looking at the mask, we know the following is true in an octet
8 7 6 5 4 3 2 1 - bit number
128 64 32 16 8 4 2 1 - value

We start from the left so two bits = bits 8 and bit 7= the 128 and the 64. 128 + 64 = 192 - the third octet
and so on.

There are lots of walk throughs of this written by people that you can Google but once you have the hang of things you don't need a calculator at all.

Keith
0

Experts Exchange Solution brought to you by