Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
How does IPv4 Subnetting Work?

I thought I understood this but I am momentarily confused. Here is an example:

Are all IPv4 addresses from 192.168.0.0 to 192.168.255.255 in the private range, regardless of subnet mask / routing prefix?

According to this page http://en.wikipedia.org/wiki/Reserved_IP_addresses, the CIDR prefix 192.168.0.0/16 is not routed on the public internet. My understanding is this means that all IP addresses from 192.168.0.0 to 192.168.255.255 are private, if you are using a subnet mask of 255.255.0.0/routing prefix of 16.

I thought that means if your subnet mask is 255.255.255.0/routing prefix is 24, you are no longer covered in the private range, because you are not on the same subnet when using a prefix of 24 instead of 16.

Is this correct? If this is not correct, can someone explain how the addressing using prefix 24 still covers prefix 16? I know there is a lot of info on the net about subnetting; if there is somewhere that answers this specific question please point me to it.

Edit: is it that a smaller routing prefix would not guarantee the IP to be in the same range, but a larger routing prefix would?

share|improve this question

marked as duplicate by Skyhawk, Michael Hampton, Chris S Nov 7 '12 at 2:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
by the way, if you use chrome, there's a really handy chrome app called "subnet calculator" that helps with a lot of these issues. –  Sirex Nov 6 '12 at 23:28
add comment

2 Answers

up vote 8 down vote accepted

Think of the /16 and /24's as a notation for how large a network is. A /24 is ~255 times smaller than a /16, but that does not mean it's not in the same range of addresses.

so yes, 192.168.0.0/24 is private, so is 192.168.1.0/24, as both are subsets of 192.168.0.0/16.

share|improve this answer
add comment

Yes, that is correct.

Maybe the wikipedia article should be improved with if you are using a subnet mask of 255.255.0.0/routing prefix of 16 OR SMALLER.

Though I am not sure smaller is clear in this context. Smaller value? Smaller net? Smaller host part. Maybe 192.168/Foo where foo is 16 or larger. (Damm. Clear documentation is hard.)

If one source is confusing then I like to consult another source as reference. Serverfault has one such source at http://serverfault.com/questions/49765/how-does-ipv4-subnetting-work

share|improve this answer
    
I think in this case, "smaller" means towards 0 on a number line. –  taz Nov 6 '12 at 23:36
1  
I had to think about it. When I have to do that with a sentence I wrote myself then I am not writing the clearest explanation (or documentation) ever. My habit is to mark such things and revise them after a break. (Or add graphics. Sometimes a picture actually is worth a thousand words.) –  Hennes Nov 6 '12 at 23:42
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.