What is a valid public IPv6 address?
An IPv6 address is an address with 32 bits and a length of 128 bits.
There are plenty of addresses left over that aren't assigned, so we could use them for testing, development, or other uses.
However, some addresses are reserved and shouldn't be used for anything. The reserved addresses are called special use addresses and are listed in the IANA IPv6 Address Registry. The addresses listed in the IANA IPv6 Address Registry are the public IPv6 addresses which are considered valid. The addresses that are not listed in the IANA IPv6 Address Registry are private addresses and not valid.
To check if a public IPv6 address is valid, first check if it's listed in the IANA IPv6 Address Registry. If it is listed, then it is valid. Otherwise it's not valid.
Public IPv6 addresses are required by RFC 6166 and the Internet Assigned Numbers Authority (IANA) who is responsible for allocating addresses to all IP-based networks. The IANA also maintains the official list of reserved IPv6 addresses.
The first 64 bits of the 128 bits are the network portion. The last 64 bits of the 128 bits are the host portion.
If the last two zeroes (0011) in the host portion of the IPv6 address are not removed, the address is considered a global unicast address. Otherwise, the address is considered a link-local address. A global unicast address is one that is assigned to the global Internet and must be unique on the global Internet. For example, a global unicast address would be 2001:db8:200::1. A link-local address is one that is assigned to the local network and is not intended to be used on the global Internet.
Each byte in the host portion of the IPv6 address has a value between 0 and 255. However, a public IPv6 address is only a 16-byte binary number. The public IPv6 address can be represented in a number of ways.
Are all IPv6 addresses public?
How do I know if an IPv6 address is public or private?
I was wondering if I could use public prefixes to get a list of all IPv6 addresses in a specific country. If the prefixes are public then I could scan through them to find all IPv6 addresses in my country.
You don't, you know nothing about the address at all. There are no public prefixes. You don't know anything about the address, so you can't tell. Yes, this is possible. There's a very simple solution using nmap which is basically doing a port scan against the public DNS for the target ipv6 address and seeing if it can connect to ntp.pool.org or similar. However, it's not really useful because it will only work in some cases.
There's no reason why someone can't simply run a nmap scan against the public DNS and have a list of all the IP addresses within a given country. However, your ISP may prevent access to that if you're not on their network, and they could be blocking those things from coming through.
Does IPv6 have a range?
IPv6 is supposed to be large and have a range that covers the entire globe.
If it has no range, then how can it be a global address? It may sound a bit odd, but I think the answer is a simple "no". For example, if you ask a typical computer on a network, "Who's your nearest neighbor?", the answer is likely to be "Well, that depends", followed by a list of six or seven addresses, and the name of a site at one of those addresses. In fact, that's what the IPv6 FAQ says: IPv6 does not have a global address space. There is no "IPv6 address" in the way that "IPv4 address" refers to an IPv4 address.
Which sounds very much like "no", but also sounds like it's "not what you'd expect". And the RFCs don't say that either. They say: The Internet Assigned Numbers Authority (IANA) assigns a range of. addresses from 2001:0000::/32 to 2001:FFFF::/33, inclusive, as. described in The IANA also reserves the addresses 2001:0000:0:0:0/128 and 2001:0:0:0:0/128. for experimental purposes. This is a really, long list of things that might be true, and which IANAs are free to decide upon their own whim.
Related Answers
What is private IPv6 address examples?
No. All IPv6 addresses are public Addresses, even the temporar...
How do I calculate IPv6?
IPv6 is basically an extension of the IPv4 protocol. It is almost...
Should I change IPv4 or IPv6 DNS?
You might be interested to know that at the time of writing,...