4

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?

taz
  • 151
  • 6
  • 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 06 '12 at 23:28

2 Answers2

8

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.

gravyface
  • 13,957
  • 19
  • 68
  • 100
Sirex
  • 5,499
  • 2
  • 33
  • 54
1

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 How does IPv4 Subnetting Work?

Hennes
  • 4,842
  • 1
  • 19
  • 29
  • I think in this case, "smaller" means towards 0 on a number line. – taz Nov 06 '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 06 '12 at 23:42