
최신 업데이트가 포함된 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)
DHCP 서버가 나에게 제공하려는 링크가 아닌 링크 로컬 IPv6이므로 좋지 않습니다. 그래서 /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 서버 주소 등만 제공합니다.
데비안 7에서는 이/etc/network/interfaces
구성은 SLAAC 또는 상태 비저장 DHCPv6에 사용될 수 있습니다.
iface eth0 inet6 auto
상태 저장 DHCPv6에서 DHCPv6 서버는 IPv6 주소 할당도 제공합니다. SLAAC는 사용되지 않습니다. 이는 다음과 같이 구성됩니다.
iface eth0 inet6 dhcp