22.16. IPv6

¸¶ºî: Aaron Kaplan. ºÆ¹½À®¤ÈÄɵ­: Tom Rhodes.

IPv6 (IPng “IP next generation” ¤È¤â¸Æ¤Ð¤ì¤Þ¤¹) ¤Ï¡¢Ãø̾¤Ê IP ¥×¥í¥È¥³¥ë (IPv4 ¤È¤â¸Æ¤Ð¤ì¤Þ¤¹) ¤Î¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Ç¤¹¡£ ¾¤ÎºÇ¿·¤Î *BSD ¥·¥¹¥Æ¥à¤ÈƱÍÍ¤Ë FreeBSD ¤Ï KAME IPv6 ¥ê¥Õ¥¡¥ì¥ó¥¹¼ÂÁõ¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤¢¤Ê¤¿¤Î FreeBSD ¥·¥¹¥Æ¥à¤Ë¤Ï IPv6¤ò»î¤¹¤¿¤á¤ËɬÍפʤâ¤Î¤¹¤Ù¤Æ¤¬È÷¤ï¤Ã¤Æ¤¤¤Þ¤¹¡£ ¤³¤ÎÀá¤Ç¤Ï IPv6 ¤ÎÀßÄê¤È¼Â¹Ô¤Ë´Ø¤·¤ÆÀâÌÀ¤·¤Þ¤¹¡£

1990 ǯÂå¤Î¤Ï¤¸¤á¤Ë¤Ï¡¢¿Í¡¹¤Ï IPv4 ¥¢¥É¥ì¥¹¶õ´Ö¤¬µÞ®¤Ë½Ì¾®¤·¤Æ¤¤¤ë¤³¤È¤Ëµ¤¤Å¤¯¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£ ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ÎÀ®Ä¹Î¨¤¬ÁýÂ礹¤ë¤Ë¤·¤¿¤¬¤Ã¤Æ¡¢ 2 ¤Ä¤Î¿´ÇÛ¤´¤È¤¬¤Ç¤Æ¤­¤Þ¤·¤¿¡£

IPv6 ¤Ï°Ê²¼¤Î¡¢¤½¤·¤Æ¤½¤Î¾¿¤¯¤ÎÌäÂê¤ò°·¤¤¤Þ¤¹¡£

¾¤Ë¤â°Ê²¼¤Î¤è¤¦¤Ë IPv6 ¤ÎÊØÍø¤Êµ¡Ç½¤¬¤¿¤¯¤µ¤ó¤¢¤ê¤Þ¤¹¡£

¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï²¼µ­¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

22.16.1. IPv6 ¥¢¥É¥ì¥¹¤ÎÇØ·Ê

¤¤¤¯¤Ä¤«°ã¤¦¥¿¥¤¥×¤Î IPv6 ¥¢¥É¥ì¥¹¤¬¤¢¤ê¤Þ¤¹¡£ ¥æ¥Ë¥­¥ã¥¹¥È (Unicast)¡¢¥¨¥Ë¡¼¥­¥ã¥¹¥È (Anycast) ¤ª¤è¤Ó¥Þ¥ë¥Á¥­¥ã¥¹¥È (Multicast) ¤Ç¤¹¡£

¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¼þÃΤΥ¢¥É¥ì¥¹¤Ç¤¹¡£ ¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ØÁ÷¤é¤ì¤¿¥Ñ¥±¥Ã¥È¤Ï¡¢ ¤Þ¤µ¤Ë¤½¤Î¥¢¥É¥ì¥¹¤Ë°¤¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ËÅþÃ夷¤Þ¤¹¡£

¥¨¥Ë¡¼¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤È¹½Ê¸¾åȽÊÌÉÔ²Äǽ¤Ç¤¹¤¬¡¢ ¥¤¥ó¥¿¥Õ¥§¡¼¥¹·²¤Ë°¸¤Æ¤é¤ì¤Æ¤¤¤Þ¤¹¡£ ¥¨¥Ë¡¼¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¤é¤ì¤¿¥Ñ¥±¥Ã¥È¤Ï (¥ë¡¼¥¿¥á¥È¥ê¥Ã¥¯Åª¤Ë) ºÇ¤â¶á¤¤¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ËÅþÃ夷¤Þ¤¹¡£ ¥¨¥Ë¡¼¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¥ë¡¼¥¿¤Ç¤·¤«»È¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£

¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹·²¤ò¼±Ê̤·¤Þ¤¹¡£ ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¤é¤ì¤¿¥Ñ¥±¥Ã¥È¤Ï¡¢ ¥Þ¥ë¥Á¥­¥ã¥¹¥È·²¤Ë°¤¹¤ë¤¹¤Ù¤Æ¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ËÅþÃ夷¤Þ¤¹¡£

注意: IPv4 ¤Î¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹ (Ä̾ï xxx.xxx.xxx.255) ¤Ï¡¢IPv6 ¤Ç¤Ï¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Çɽ¸½¤µ¤ì¤Þ¤¹¡£

表 22-2. ͽÌ󤵤줿 IPv6 ¥¢¥É¥ì¥¹

IPv6 ¥¢¥É¥ì¥¹ ¥×¥ì¥Õ¥£¥Ã¥¯¥¹Ä¹ (¥Ó¥Ã¥È) ÀâÌÀ È÷¹Í
:: 128 ¥Ó¥Ã¥È ÉÔÆÃÄê IPv4 ¤Î 0.0.0.0 »²¾È
::1 128 ¥Ó¥Ã¥È ¥ë¡¼¥×¥Ð¥Ã¥¯¥¢¥É¥ì¥¹ IPv4 ¤Î 127.0.0.1 »²¾È
::00:xx:xx:xx:xx 96 ¥Ó¥Ã¥È IPv4 Ëä¤á¹þ¤ß¥¢¥É¥ì¥¹ ²¼°Ì¤Î 32 ¥Ó¥Ã¥È¤Ï IPv4 ¥¢¥É¥ì¥¹¤Ç¤¹¡£ “IPv4 ¸ß´¹ IPv6 ¥¢¥É¥ì¥¹” ¤È¤â¸Æ¤Ð¤ì¤Þ¤¹¡£
::ff:xx:xx:xx:xx 96 ¥Ó¥Ã¥È IPv4 ¼Í±Æ IPv6 ¥¢¥É¥ì¥¹ ²¼°Ì¤Î 32 ¥Ó¥Ã¥È¤Ï IPv4 ¥¢¥É¥ì¥¹¤Ç¤¹¡£ IPv6 ¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¥Û¥¹¥È¤ËÂФ¹¤ë¥¢¥É¥ì¥¹¤Ç¤¹¡£
fe80:: - feb:: 10 ¥Ó¥Ã¥È ¥ê¥ó¥¯¥í¡¼¥«¥ë IPv4 ¤Î¥ë¡¼¥×¥Ð¥Ã¥¯¥¢¥É¥ì¥¹»²¾È
fec0:: - fef:: 10 ¥Ó¥Ã¥È ¥µ¥¤¥È¥í¡¼¥«¥ë  
ff:: 8 ¥Ó¥Ã¥È ¥Þ¥ë¥Á¥­¥ã¥¹¥È  
001 (´ð¿ô 2) 3 ¥Ó¥Ã¥È ¥°¥í¡¼¥Ð¥ë¥æ¥Ë¥­¥ã¥¹¥È ¤¹¤Ù¤Æ¤Î¥°¥í¡¼¥Ð¥ë¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¤³¤Î¥×¡¼¥ë¤«¤é³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£ ¤Ï¤¸¤á¤Î 3 ¥Ó¥Ã¥È¤Ï “001” ¤Ç¤¹¡£

22.16.2. IPv6 ¥¢¥É¥ì¥¹¤òÆɤà

Àµµ¬¤Î½ñ¼°¤Ç¤Ï x:x:x:x:x:x:x:x ¤Èɽ¤µ¤ì¤Þ¤¹¡£¤½¤ì¤¾¤ì¤Î “x” ¤Ï 16 ¥Ó¥Ã¥È¤Î 16 ¿Ê¿ô¤Ç¤¹¡£¤¿¤È¤¨¤Ð FEBC:A574:382B:23C1:AA49:4592:4EFE:9982 ¤È¤Ê¤ê¤Þ¤¹¡£

¤¹¤Ù¤Æ¥¼¥í¤ÎŤ¤Éôʬʸ»úÎ󤬥¢¥É¥ì¥¹Æâ¤Ë¤è¤¯¸½¤ì¤Þ¤¹¡£ ¤½¤Î¤¿¤á¡¢¤½¤Î¤è¤¦¤ÊÉôʬʸ»úÎó¤Ï “::” ¤Ëû½Ì¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤¿¤È¤¨¤Ð¡¢fe80::1 ¤ÏÀµµ¬·Á¤Î fe80:0000:0000:0000:0000:0000:0000:0001 ¤ËÂбþ¤·¤Þ¤¹¡£

3 ÈÖÌܤηÁ¼°¤Ï¡¢ºÇ¸å¤Î 32 ¥Ó¥Ã¥È¤ÎÉôʬ¤ò “.” ¤òʬ³äʸ»ú¤È¤·¤Æ»È¤¦¡¢ ¤Ê¤¸¤ß¿¼¤¤ IPv4 (10 ¿Ê) ·Á¼°¤Ç½ñ¤¯¤³¤È¤Ç¤¹¡£ ¤¿¤È¤¨¤Ð 2002::10.0.0.1 ¤Ï (16 ¿Ê) Àµµ¬·Á¤Î 2002:0000:0000:0000:0000:0000:0a00:0001 ¤ËÂбþ¤·¡¢Æ±»þ¤Ë 2002::a00:1 ¤È½ñ¤¯¤³¤È¤È¤âÅù²Á¤Ç¤¹¡£

¤³¤³¤Þ¤ÇÍè¤ì¤Ð¡¢²¼µ­¤òÍý²ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£

# ifconfig
rl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
         inet 10.0.0.10 netmask 0xffffff00 broadcast 10.0.0.255
         inet6 fe80::200:21ff:fe03:8e1%rl0 prefixlen 64 scopeid 0x1
         ether 00:00:21:03:08:e1
         media: Ethernet autoselect (100baseTX )
         status: active

fe80::200:21ff:fe03:8e1%rl0 ¤Ï¼«Æ°Åª¤ËÀßÄꤵ¤ì¤¿¥ê¥ó¥¯¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ç¤¹¡£ ¤³¤ì¤Ï¼«Æ°ÀßÄê¤Î°ì´Ä¤È¤·¤Æ¡¢ ¥¤¡¼¥µ¥Í¥Ã¥È MAC ¥¢¥É¥ì¥¹¤òÊÑ´¹¤·¤¿¤â¤Î¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£

IPv6 ¥¢¥É¥ì¥¹¹½Â¤¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤Ï RFC3513 ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£

22.16.3. Àܳ

¸½ºß¡¢Â¾¤Î IPv6 ¥Û¥¹¥È¤ª¤è¤Ó¥Í¥Ã¥È¥ï¡¼¥¯¤ËÀܳ¤¹¤ë¤¿¤á¤Ë¤Ï 4 ¤Ä¤ÎÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£

¤³¤³¤Ç¤Ï¡¢¸½ºß¤â¤Ã¤È¤â¤è¤¯»È¤ï¤ì¤Æ¤¤¤ëÊýË¡¤È»×¤ï¤ì¤ë 6bone ¤ØÀܳ¤¹¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£

¤Ï¤¸¤á¤Ë 6bone ¥µ¥¤¥È¤ò¤ß¤Æ¡¢ ¤¢¤Ê¤¿¤ËºÇ¤â¶á¤¤ 6bone ÀܳÀè¤ò¸«¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£ ÀÕǤ¼Ô¤ËÏ¢Íí¤¹¤ë¤È¡¢¾¯¤·¤Ð¤«¤ê±¿¤¬¤è¤±¤ì¤Ð¡¢ Àܳ¤òÀßÄꤹ¤ëÊýË¡¤Ë¤Ä¤¤¤Æ¤Î»Ø¼¨¤ò¼õ¤±¤é¤ì¤ë¤Ç¤·¤ç¤¦¡£ ¿¤¯¤Î¤Ð¤¢¤¤¡¢¤³¤ì¤Ë¤Ï GRE (gif) ¥È¥ó¥Í¥ë¤ÎÀßÄ꤬´Þ¤Þ¤ì¤Þ¤¹¡£

ÌõÃí: 6bone ¤Ï 3ffe:: (16 ¥Ó¥Ã¥È) ¤È¤¤¤¦ IPv6 ¥¢¥É¥ì¥¹¤ò³ä¤ê¿¶¤é¤ì¤¿¼Â¸³ÌÜŪ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ç¤·¤¿¤¬¡¢ 2006 ǯ 6 ·î¤Ë±¿ÍѤòÄä»ß¤¹¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ¾¤Î¾¦ÍѤä»î¸³Åª¤Ê IPv6 Àܳ¥µ¡¼¥Ó¥¹¤òõ¤·¤Æ¤¯¤À¤µ¤¤¡£

¤³¤³¤Ë gif(4) ¥È¥ó¥Í¥ë¤òÀßÄꤹ¤ëŵ·¿Åª¤ÊÎã¤ò¼¨¤·¤Þ¤¹¡£

# ifconfig gif0 create
# ifconfig gif0
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
# ifconfig gif0 tunnel MY_IPv4_ADDR  HIS_IPv4_ADDR
# ifconfig gif0 inet6 alias MY_ASSIGNED_IPv6_TUNNEL_ENDPOINT_ADDR

Âçʸ»ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëñ¸ì¤ò¡¢ ¾åή¤Î 6bone ¥Î¡¼¥É¤«¤é¼õ¤±¼è¤Ã¤¿¾ðÊó¤ËÃÖ¤­´¹¤¨¤Æ¤¯¤À¤µ¤¤¡£

¤³¤ì¤Ç¥È¥ó¥Í¥ë¤¬³ÎΩ¤µ¤ì¤Þ¤¹¡£ping6(8) ¤ò ff02::1%gif0 ¤ËÁ÷¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥È¥ó¥Í¥ë¤¬Æ°ºî¤·¤Æ¤¤¤ë¤«³Î¤«¤á¤Æ¤¯¤À¤µ¤¤¡£ ping ¤Î±þÅú¤ò 2 ¤Ä¼õ¤±¼è¤ë¤Ï¤º¤Ç¤¹¡£

注意: ff02:1%gif0 ¤È¤¤¤¦¥¢¥É¥ì¥¹¤Ë¶½Ì£¤ò¤½¤½¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤¿¤á¤ËÀâÌÀ¤¹¤ë¤È¡¢ ¤³¤ì¤Ï¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ç¤¹¡£ %gif0 ¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¥Õ¥§¡¼¥¹ gif0 ¾å¤Î¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤¬»ÈÍѤµ¤ì¤ë¤È¤¤¤¦¤³¤È¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£ ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÂФ·¤Æ ping ¤òÁ÷¤Ã¤¿¤Î¤Ç¡¢¥È¥ó¥Í¥ë¤Î¤â¤¦°ìÊý¤Îü¤â±þÅú¤·¤Þ¤¹¡£

¤³¤³¤Þ¤ÇÍè¤ë¤È 6bone ¥¢¥Ã¥×¥ê¥ó¥¯¤Ë·ÐÏ©ÀßÄꤹ¤ë¤³¤È¤ÏÈæ³ÓŪ´Êñ¤Ç¤·¤ç¤¦¡£

# route add -inet6 default -interface gif0
# ping6 -n MY_UPLINK
# traceroute6 www.jp.FreeBSD.org
(3ffe:505:2008:1:2a0:24ff:fe57:e561) from 3ffe:8060:100::40:2, 30 hops max, 12 byte packets
     1  atnet-meta6  14.147 ms  15.499 ms  24.319 ms
     2  6bone-gw2-ATNET-NT.ipv6.tilab.com  103.408 ms  95.072 ms *
     3  3ffe:1831:0:ffff::4  138.645 ms  134.437 ms  144.257 ms
     4  3ffe:1810:0:6:290:27ff:fe79:7677  282.975 ms  278.666 ms  292.811 ms
     5  3ffe:1800:0:ff00::4  400.131 ms  396.324 ms  394.769 ms
     6  3ffe:1800:0:3:290:27ff:fe14:cdee  394.712 ms  397.19 ms  394.102 ms

¤³¤Î½ÐÎϤϥޥ·¥ó¤Ë¤è¤Ã¤Æ°Û¤Ê¤ê¤Þ¤¹¡£ ¤³¤ì¤Ç¡¢¤¢¤Ê¤¿¤¬ www/mozilla ¤Î¤è¤¦¤Ê IPv6 ¤¬ÍøÍѲÄǽ¤Ê¥Ö¥é¥¦¥¶¤ò»ý¤Ã¤Æ¤¤¤ì¤Ð¡¢ IPv6 ¥µ¥¤¥È www.kame.net ¤Ë¤¤¤Ã¤ÆÍ٤륫¥á¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£

22.16.4. IPv6 À¤³¦¤Î DNS

IPv6 ¤Î¤¿¤á¤Î¿·¤·¤¤ DNS ¥ì¥³¡¼¥É¤¬ 2 ¼ïÎढ¤ê¤Þ¤¹¡£

AAAA ¥ì¥³¡¼¥É¤Ï´Êñ¤Ë»È¤¨¤Þ¤¹¡£

MYHOSTNAME           AAAA    MYIPv6ADDR

¾åµ­¤ò¥×¥é¥¤¥Þ¥ê¥¾¡¼¥ó DNS ¥Õ¥¡¥¤¥ë¤Ë²Ã¤¨¤Æ¡¢ ¤â¤é¤Ã¤¿¤Ð¤«¤ê¤Î IPv6 ¥¢¥É¥ì¥¹¤Ë¥Û¥¹¥È̾¤ò³ä¤êÅö¤Æ¤Æ¤¯¤À¤µ¤¤¡£ ¤¢¤Ê¤¿¼«¿È¤Ç DNS ¥¾¡¼¥ó¤ò´ÉÍý¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ DNS ¥×¥í¥Ð¥¤¥À¤ËÍê¤ó¤Ç¤¯¤À¤µ¤¤¡£ bind ¤ÎºÇ¿·¥Ð¡¼¥¸¥ç¥ó (¥Ð¡¼¥¸¥ç¥ó 8.3 ¤ª¤è¤Ó 9) ¤Ï AAAA ¥ì¥³¡¼¥É¤ËÂбþ¤·¤Æ¤¤¤Þ¤¹¡£

ËÜʸ½ñ¡¢¤ª¤è¤Ó¾¤Îʸ½ñ¤Ï ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/ ¤«¤é¥À¥¦¥ó¥í¡¼¥É¤Ç¤­¤Þ¤¹¡£

FreeBSD ¤Ë´Ø¤¹¤ë¼ÁÌ䤬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¥É¥­¥å¥á¥ó¥È ¤òÆɤó¤À¾å¤Ç <questions@FreeBSD.org> ¤Þ¤Ç (±Ñ¸ì¤Ç) Ï¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£
ËÜʸ½ñ¤Ë´Ø¤¹¤ë¼ÁÌä¤Ë¤Ä¤¤¤Æ¤Ï¡¢<doc@FreeBSD.org> ¤Þ¤ÇÅŻҥ᡼¥ë¤ò (±Ñ¸ì¤Ç) Á÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£