0

i found this link for How to calculate number of hosts between two ips for ipv4 How to calculate number of hosts between two ips? c#

is there any calculation like that for ipv6 for example between: 2a00:1288:110:8b1::2000 and 2a00:1288:110:8b1::21f9

Please help

stackuser
  • 101
  • 2
  • 7
  • 1
    It's just hexadecimal math. You can do that in just about any language. But the number of _hosts_ between those two addresses is usually zero, not the same as the number of _addresses_. – Michael Hampton Nov 22 '18 at 01:42
  • changed the title from hosts to ips – stackuser Nov 22 '18 at 01:48
  • There are only two IPs (IPv4 and IPv6). IP means Internet Protocol. The title doesn't make any real sense. Perhaps you mean, "_How to calculate number of addresses between two IPv6 addresses_?" – Ron Maupin Nov 22 '18 at 04:08
  • did you have a language in mind? If the answer you want is hosts, do you need to take into account that a host normally gets a /64? – danblack Nov 22 '18 at 05:41
  • in perl or shell or python or as simple linux command – stackuser Nov 22 '18 at 06:25

1 Answers1

1

An IPv6 address is a 128 bit number. Like the IPv4 example, use the language functions to convert it to this number and take the differences between the two.

danblack
  • 12,130
  • 2
  • 22
  • 41