Check whether you have one
See whether your connection has a public IPv6 address:
The full form
2001:0db8:0000:0000:0000:ff00:0042:8329
Eight groups, each 16 bits, so 8 × 16 = 128 bits. Digits are 0 to 9 and a to f, and are case-insensitive. Lowercase is the recommended way to write them.
Shortening rules
- Drop leading zeros in each group:
0db8becomesdb8and0042becomes42. - Replace the longest run of all-zero groups with
::. Use it only once, or the address would be ambiguous.
2001:0db8:0000:0000:0000:ff00:0042:8329
2001:db8:0:0:0:ff00:42:8329 (leading zeros dropped)
2001:db8::ff00:42:8329 (zero run replaced)
- A single zero group is left as
0, not turned into::. - If two runs are equally long, the first one is shortened.
- The all-zero address is
::and the loopback address is::1.
Valid and invalid examples
| Address | Valid? | Why |
|---|---|---|
2001:db8::1 | Yes | Normal shortened form. |
fe80::1ff:fe23:4567:890a | Yes | Link-local address. |
2001:db8::1::2 | No | Two :: in one address. |
2001:db8:12345::1 | No | A group has more than four digits. |
2001:db8:0:0:0:0:0:0:1 | No | Nine groups. |
2001:dg8::1 | No | g isn't a hex digit. |
Prefixes you will see
| Prefix | Meaning |
|---|---|
2000::/3 | Global unicast: normal public addresses, most start with 2 or 3. |
fe80::/10 | Link-local: automatic, works only on the local network segment. |
fc00::/7 | Unique local: private addresses, in practice starting fd. |
::1/128 | Loopback, the machine itself. |
2001:db8::/32 | Reserved for documentation and examples. |
::ffff:192.0.2.1 | An IPv4 address carried inside IPv6 (IPv4-mapped). |
Network and host parts
Like IPv4, an address splits into a network prefix and a host part, written with a slash: 2001:db8:abcd:12::/64. A /64 is the standard size of one network. Providers typically give homes a /56 or /60 and businesses a /48, so you can run many networks. Prefix arithmetic is covered in the subnetting cheat sheet.
In URLs and commands
- URLs need square brackets:
http://[2001:db8::1]:8080/. - Many tools take
-6to force IPv6, such asping -6andcurl -6. - A link-local address needs the interface:
fe80::1%eth0.
For how IPv6 differs from IPv4 overall, read IPv4 vs IPv6, and to check your own connection see how to test IPv6.