
私は最新のアップデートを適用した Debian 7 を使用しています。
プロバイダから IPv6 アドレスのブロックを取得しており、プロバイダによると、DHCP サーバーは IP を自動的に取得するように設定されている (プロバイダに問い合わせたところ) のですが、うまくいきません。IPv4 は自動的に取得するので、問題なく動作します。グーグルなどで調べた結果、/etc/network/interfaces ファイルが原因であることが分かりました。その開始位置は次のとおりでした。
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
そして、これは開始位置での ifconfig -a です (実際の IPv4 をダンプしたくないので IPv4 アドレスは変更されていますが、IPv6 は変更されていません)。
sudo ifconfig -a
[sudo] password for **:
eth0 Link encap:Ethernet HWaddr <**>
inet addr:188.105.484.221 Bcast:188.105.484.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe8c:3b20/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3290 errors:0 dropped:0 overruns:0 frame:0
TX packets:304 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:407068 (397.5 KiB) TX bytes:36628 (35.7 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1104 (1.0 KiB) TX bytes:1104 (1.0 KiB)
リンクローカル IPv6 ですが、これも DHCP サーバーが提供したいものではないので、役に立ちません。そこで、/etc/network/interfaces を変更しました。
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 dhcp
そして、ファイアウォールも迷惑になる可能性があると読んだので、ファイアウォール ルールをフラッシュしました。そこで、次の操作を実行しました。
ifdown eth0 && ifup eth0
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/56:54:00:7b:3b:20
Sending on LPF/eth0/56:54:00:7b:3b:20
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPOFFER from 188.105.484.254
DHCPACK from 188.105.484.254
bound to 188.105.484.221 -- renewal in 38715 seconds.
そして、ハングして待機するだけです。 IPv4 を取得した後、IPv6 の検索を開始したいようですが、検索されないか何かです。 ifconfig -a は以前と同じように見えます。何が間違っているのでしょうか? IPv6 アドレスを取得するにはどうすればよいでしょうか?
- - 編集 - -
静的 IP を使用して動作しました: /etc/network/interfaces (繰り返しますが、IPv6 アドレスは実際に持っているものではありません)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
#iface eth0 inet6 auto
# accept_ra 1
#iface eth0 inet6 dhcp
# accept_ra 1
iface eth0 inet6 static
address 2a01:9b8:aaf:1dg::1
gateway 2a01:9b8:aaf::1
netmask 48
答え1
これは、プロバイダーがステートレス DHCPv6 を使用しているか、ステートフル DHCPv6 を使用しているかによって異なります。
ステートレス DHCPv6 では、IP アドレスは実際には SLAAC 経由で設定され、DHCPv6 サーバーは DNS サーバー アドレス、NTP サーバー アドレスなどのみを提供します。
Debian 7では、これは/etc/network/interfaces
この設定は SLAAC またはステートレス DHCPv6 のいずれにも使用できます。
iface eth0 inet6 auto
ステートフル DHCPv6 では、DHCPv6 サーバーが IPv6 アドレスの割り当ても提供します。SLAAC は使用されません。これは次のように設定されます。
iface eth0 inet6 dhcp