IPv6の短縮と展開
1行に1アドレス。入力に合わせてブラウザ内で変換します。
3行中3行が有効なIPv6アドレスです。
- 短縮形(RFC 5952)
2001:db8::ff00:42:8329
展開形2001:0db8:0000:0000:0000:ff00:0042:8329
- 短縮形(RFC 5952)
2a00:1450:4010:c0b::64
展開形2a00:1450:4010:0c0b:0000:0000:0000:0064
- 短縮形(RFC 5952)
::ffff:192.0.2.1
展開形0000:0000:0000:0000:0000:ffff:c000:0201
このテキストはまだ日本語で提供されていません。翻訳が公開されるまで英語で表示しています。
An IPv6 address has 128 bits, written as eight groups of four hexadecimal digits. Almost nobody writes all 32 digits: leading zeros in a group may be dropped, and one run of all-zero groups may be replaced by ::.
Because several short forms are possible, RFC 5952 defines one canonical form that every tool should output: lower-case hex, no leading zeros, :: used for the longest run of two or more zero groups (the first one if there is a tie), and never for a single zero group. 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329.
The expanded form, with all eight groups and every leading zero, is what you need for sorting text, for some configuration files and for building reverse DNS names (ip6.arpa).
よくある質問
Why does :: appear only once?
Because two :: would be ambiguous: in 2001::1::2 nobody could tell how many zero groups each one stands for.
Are upper-case letters wrong?
They are valid input, but RFC 5952 asks for lower case in output, so logs, configuration and comparisons stay consistent.
What about addresses with an IPv4 part, like ::ffff:192.0.2.1?
They are accepted. The compressed output keeps the dotted IPv4 part for IPv4-mapped addresses, as RFC 5952 recommends.