How many usable subnets with subnet mask 255.255.128.0 with a class B IP address?
The rule is I can't use the first and last subnets. So with a class B IP address and a subnet mask of 255.255.128.0, how many usable subnets will it give me?
255.255.128.0 is the same as 11111111.11111111.10000000.00000000.
That is the same as nnnnnnnn.nnnnnnnn.shhhhhhh.hhhhhhhh.
According to me, the third octet uses one bit for the subnet mask. So if I do 2^1-2, I get 0. That means no subnets. Is this right?
No. The answer is two subnets. The equation to work out the number of subnets is 2^n where "n" is equal to the number of hosts bits borrowed.
For quite some time now Cisco has said that the first and last subnet can indeed be used. However you continue to subtract 2 when dealing with the number of hosts on a subnet, to cover the subnet number and the broadcast address.
If you are using study material which states that you cannot use the first and last subnet, then that material is well out of date.
Thanks for your reply. So if I were to remove the last and first subnet, I would have to use the .192 mask instead and have less hosts?
I always thought it was Internet standard to remove the first and last subnets. Not sure though. So I assume that by default that Cisco routers now defaultly use all subnets?
And on the same subject, if I didn't want to use the first and last, I would enter the no ip subnet zero command. That would stop me using the first subnet (subnet 0). But what about a command for the last subnet not to be used?
I am not sure what you mean when you ask "So if I were to remove the last and first subnet, I would have to use the .192 mask instead and have less hosts? ", as given the criteria you gave in your original post, using the mask 255.255.128.0, if you remove the first and last subnet then there would be no usable subnets.
Using a mask of 255.255.192.0 would give you 4 smaller subnets the the original mask and if you don't use the first and last subnet, you would have two remaining subnets to use.
The mask 255.255.128.0 provides 2 subnets, each with 32,766 hosts.
The mask 255.255.192.0 provides 4 subnets, each with 16,382 hosts.
At the beginning it was the standard practice not to use the first and last subnet. However once the IPv4 address space started to run out, I supposed it was realised how wasteful a practice this actually was. If you take your example of using 255.255.192.0 and not using the 1st and last subnet, then 32,768 addresses are wasted.
Not too sure about the "no ip subnet zero" commands affect on the last subnet.
Hi I was reading the comment of the posting, and when I was in CCNP bootcamp we discussed Anding. based on the 1 and the 0's 1 being on and 0 being off, you could not use the first bit in your subnet mask, you had to use at least the first two bit's in the subnet mask. By doing so the ANDing process which any combination of 1 and 0 is 1, and 0 and 0 is 0, two bit's need to be 1's. And eaiser way to figured this out is the bit value, let's say your mask is 255.255.224.0 of a class c address, the first three bit's are used, the value of bit number three is 32 if you substract 2 from 32 your get 30 usable subnet in a classful subnet. I am just adding to the disscussion here. HTH
Michael has been providing pretty good information in his answers. I would just like to clarify the issue of no ip subnet-zero and to add a comment about this issue in general.
The ip subnet-zero command allowed the use of the first subnet of the network (the subnet in which all of the subnet bits were zero). It never controlled the use of the last subnet. Even if you configure no ip subnet-zero the last subnet is still useable. (The last subnet is always useable no matter what you configure about subnet-zero).
In the early days of the development of the IP protocol there was a restriction on the use of the very first subnet in the network and if you look in some of the very early documents and standards you will find various reasons given justifying this restriction. As the IP protocol matured this restriction was removed. In the early days of IOS the default was no ip subnet-zero but for a very long time the default has been to enable ip subnet-zero.
There are very good reasons for the rule about not using the first and last address of a subnet. Some people (and some books) have carried that concept over to the consideration of subnet allocation and advocate restricting the first and last subnets of a network. This is essentially taking a valid rule from one situation and attempting to apply it to a different situation. In the different situation the rule is not necessarily valid.
Cheers fop the information re: ip subnet zero.
As always insightful and much appreciated.
You are quite welcome. I am glad that my answer was helpful.
The forum is an excellent place to learn about Cisco networking and I encourage you to continue your participation in the forum.
This link contains some good information about subnet zero: