🔄 IPv6 Transition 5 分で読める

IPv6 Address Format

How to read, write, and abbreviate 128-bit IPv6 addresses.

IPv6 Address Structure

An IPv6 address is 128 bits long, written as eight groups of four hexadecimal digits separated by colons:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

This gives us 340 undecillion addresses (3.4 × 10^38) — enough for every grain of sand on Earth to have billions of addresses.

Abbreviation Rules

Rule 1: Drop Leading Zeros

Remove leading zeros within each group:

2001:0db8:0001:0000:0000:0000:0000:0001
→ 2001:db8:1:0:0:0:0:1

Rule 2: Collapse Consecutive Zero Groups

Replace one sequence of consecutive all-zero groups with :: (double colon). This can only be used once:

2001:db8:1:0:0:0:0:1
→ 2001:db8:1::1

If there are multiple sequences of zeros, collapse the longest one. If they're equal length, collapse the leftmost.

Address Types

Type Prefix Example Purpose
Global Unicast 2000::/3 2001:db8::1 Public internet addresses
Link-Local fe80::/10 fe80::1 Same-link communication
Unique Local fc00::/7 fd00::1 Private networks (like RFC 1918)
Multicast ff00::/8 ff02::1 One-to-many delivery
Loopback ::1/128 ::1 localhost
Unspecified ::/128 :: No address assigned

Interface Identifiers

The last 64 bits of a global unicast address form the interface identifier. This can be:

  • EUI-64 — Derived from the device's MAC address (privacy concern)
  • Random — Generated using SLAAC privacy extensions (RFC 8981)
  • Manual — Statically configured

IPv6 in URLs

When using IPv6 addresses in URLs, enclose them in square brackets:

http://[2001:db8::1]:8080/page

Subnet Notation

IPv6 uses CIDR notation just like IPv4:

2001:db8::/32    — ISP allocation
2001:db8:1::/48  — Site allocation
2001:db8:1:1::/64 — Standard subnet

The standard subnet size is /64 — giving each subnet 2^64 (18 quintillion) host addresses.

関連情報