Discussion Locked

custom subnet masks

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

For example I need to create 652 networks with class B address 150.150.0.0.

a)the subnet mask is 255.255.255.192
b)the first three valid network numbers are 150.150.0.64, 150.150.0.128, 150.150.0.192
c)the range of host ip addresses on 150.150.0.64 network is 150.150.0.65-150.150.0.126

Using the subnet goggles we see: NNNNNNNN.NNNNNNNN.SSSSSSSS.SSHHHHH.

Now I dont understand how can I get 126 which is the last number from 150.150.0.126 ip address (which represents the last valid host ip address on 150.150.0.64 network) if I have only 5 bits left in host portion.
To get 126 I need to took one bit from subnet portion. And why I cant apply rule on this example that says to figure out the range of ip addresses on each network, use this two-part equation: The first part, or start of the range = (the network address + 1), The second part, or end of the range =
For Class A, B: (the next network address - 1). If I apply this rule on my example than I'll get 127 instead 126. Why?

4 replies

by mshavrov

First of all, you have one position missing in the last octet - count them, it's only 7 positions. That's what confuses you.

Second, if you are getting lost with the subneting, use any Subnet Calculators (for example, Boson IPSubnetter).

And now about your scenario.

1. You have Class B network. It defines first 16 "N" in the subnet.

2. You need 652 subnets. It requires 10 bits, thus will generate 1024 subnets totoal.

3. Remaining bits (32-16-10=6) - your host addresses. You may have 62 hosts per subnet. Everything is right.

Good luck,

Mike
CCNP, CCDP, CCSP, MCSE W2K, Security+, etc.
http://www.ciscoheadsetadapter.com

by tech_soul7

I used Wildpackets Ip Subnet Calculator and I get correct result but I want to figure out how did I get it.
My problem is that I dont understund how can I get 126 from 6 host bits left. To get 126 I must use 7 bits which means that I need to take 1 subnet bit from subnet portion.
I've missed one position (becouse i forgot to write it) but if I add it I stil have 6 host bits.
Thanks for your help

by mshavrov

I see your confusion. Don't worry. Even though you have .126 in the last octet, it does not meen that your "host address" is .126. It's combination of 2 bits of the "subnet" and 6 bits of the "host".

126=01111110 where SS=01, and HHHHHH=111110

If you look at this at the BITs level, everything is all right. And then it's "converted" to the decimals.

Last octet in your situation has four "scenarios":

Subnets (first two bits) 00, 01, 10, 11
Hosts (last 6 bits) 000001-111110

So, that's how you get .126, .193 and above.

Good luck,

Mike
http://www.ciscoheadsetadapter.com

by tech_soul7

Yes that's all true but isn't it against the rules to take one bit from subnet portion to use it to get .126 for host portion.
If I use six bits for host portion (HHHHHH) then I'll get 62 (becouse there cannot be all ones).
Now my question is isn't it against the rules (to take on bit from subnet portion to use it for host portion)?
I know that .126 is correct result I just dont understand how can I get this number?
Now with all help I get I'm asking my self am I stupid or this is much more complicated than I thought.
Thanks again for all your help

This discussion is closed to new replies.