Is there any tutorial on how to calculate netmask for private IP address?.

Is there any tutorial on how to calculate netmask for private IP
address (for example class B addr: 172.16.xx.xx , netmask 255.255.0.0,
why can't it be 255.255.255.0?). Thanks.
Reply to
GS
Loading thread data ...
:Is there any tutorial on how to calculate netmask for private IP :address (for example class B addr: 172.16.xx.xx , netmask 255.255.0.0,
The rules are the same as for any other IP address, namely that one should look at the first octet. 0-127 as a first octet is "Class A", 128-191 is "Class B", 192-222 is "Class C", 223 and 224 are reserved for multicast, and everything above is reserved or special purpose.
What it means for an IP to fall into Class A, B, or C varies.
For older equipment, or for some of the more obscure syntax variations in newer equipment, or if one is using the RIP1 routing protocol, then Class A implies a netmask of 255.0.0.0, Class B implies a netmask of 255.255.0.0, Class C implies a netmask of 255.255.255.0, and the equipment or protocol might not allow those netmasks to be overridden.
The Cisco PIX is an example of equipment will use the Class A/B/C netmasks if you leave out an optional netmask specification... which can lead to some nasty surprises as the optional netmasks usually occur in contexts where the user would think that the PIX should *know* what the proper netmask should be, based upon the other commands.
For newer equipment, what it means for an IP to fall into Class A, B, or C, is "nothing" (except perhaps in non-extendable backwards compatability such as RIP1.) Newer equipment does not assume any netmask. Except, that is, for consumer home routers and firewalls, which are often hard coded to force a netmask of 255.255.255.0 on internal addresses.
:why can't it be 255.255.255.0?). Thanks.
172 falls into the range 128 to 191, so it is Class B, 255.255.0.0.
Why can't it be 255.255.255.0? Because that would require rewriting decades of technical specifications and attempt to force equipment that literally might have been designed 20 years ago to do something that it was not designed to do. Unless someone can find several billion barrels of oils that would become accessible if 172.16.*.* were redeclared to have a netmask of 255.255.255.0, It Ain't Gonna Happen.
The good news is that most of the time it doesn't matter anymore. Any modern (non-consumer) equipment will allow you to use a netmask of 255.255.255.0 with 172.16.x.x if that's what you want to do.
You have to know the old Class A/B/C system for tests (because you might have to work with old equipment sometime), and you need to know A/B/C in case you have reason to use RIP1, but if you want to use a netmask of (say) 255.255.192.0 with an IP that starts with 172.16, then probably your biggest obstacle would be in documenting why you happened to choose that particular mask; modern equipment with modern protocols will handle that netmask without problem.
Reply to
Walter Roberson

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.