My way to calculate netmask number of host, for example: i want to know the number of hosts for netmask 255.255.255.192 (prefix 26)
255.255.255.192 11111111.11111111.11111111.11000000 26 128+64=192
the 192 is 128+64 of the two "1" bits of the latest octet, the number of host is the number of 0 bits(host part) of the latest octet, so 000000 are 6, so 2^6-2 is 62, and ipcalc confirm is ok
ipcalc 10.2.0.1/26
Address: 10.2.0.1 00001010.00000010.00000000.00 000001
Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Wildcard: 0.0.0.63 00000000.00000000.00000000.00 111111
=>
Network: 10.2.0.0/26 00001010.00000010.00000000.00 000000
HostMin: 10.2.0.1 00001010.00000010.00000000.00 000001
HostMax: 10.2.0.62 00001010.00000010.00000000.00 111110
Broadcast: 10.2.0.63 00001010.00000010.00000000.00 111111
Hosts/Net: 62 Class A, Private Internet
My question is: how to know/calculate the number of subnets with a prefix..for example 26 or 27? I have to do the net part(26 "1" bit^2=)?