Calculate PREFIX from subnet mask in bootscripts

Gerard Beekmans gerard at linuxfromscratch.org
Tue Oct 19 07:08:27 PDT 2004


On Tue, 2004-10-19 at 08:04, Gerard Beekmans wrote:
Well, in case the math does get too complex, copying the table from this
site:

http://server1.belchfire.net/webtools/cidr_converstion_table.html

would work too. It lists all the prefixes from /1 through /32 and what
the equivalent dotted decimal netmask is, plus other things like the
hexadecimal mask, inverse netmask, binary, number of classful networks
and number of IP addresses possible.

So never mind my question about what 255.255.255.252 is. It's /30
according to this table. Good enough for me. Though I'd still appreciate
the math behind it if anybody can explain it.

-- 
Gerard Beekmans

/* If Linux doesn't have the solution, you have the wrong problem */




More information about the lfs-dev mailing list