0

Is there a way to get the number of IPv6 addresses from a Ipv6 CIDR?

for example: CIDR: 2403:3E00::/32 => need get number of ipv6 addresses: 79228162514264337593543950336

user2253402
  • 101
  • 1
  • 3
  • Is it possible to add in the function on that page (PHP5 calculate IPv6 range from cidr prefix) - http://stackoverflow.com/questions/10085266/php5-calculate-ipv6-range-from-cidr-prefix/10086404#10086404 that it additional return number of ip addresses in CIDR Prefix: ... First: ... Last: .. and NumberIP: ... ? – user2253402 Aug 18 '13 at 20:28

2 Answers2

0

An IPv6 address has 128 bits, of which (slightly simplified) a number are dedicated to network address, and the rest are dedicated to host addresses.

In your case, 32 bits are dedicated to the network part (/32), so the other 96 are dedicated to host addresses.

2^(128-32) = 2^96 = 79228162514264337593543950336 hosts
Joachim Isaksson
  • 170,943
  • 22
  • 265
  • 283
0
2^(128-32) = 2^96 = 79228162514264337593543950336 

is wrong, you still need to

79228162514264337593543950336 - 1 = 79228162514264337593543950335 hosts

PS. sorry I could not comment it to the answer of Joachim because of reputation, this is why I am not much interested in stackoverflow.

user4271704
  • 671
  • 1
  • 11
  • 33