在dnsmasq中启用DHCPv6分发固定范围的IPv6地址,但失败

把招工广告! 我想在我的Raspbian PI中创build一个AP。 我selectdnsmasq作为dhcpv4和dhcpv6服务器。 但是,我的笔记本电脑可以成功获得IPv4,但是却无法获得IPv6。 为什么dnsmasq不适用于IPv6?

# my dnsmasq.conf domain-needed no-resolv no-poll server=8.8.8.8 server=8.8.4.4 all-servers interface=wlan0 dhcp-range=192.168.233.100, 192.168.233.200, 255.255.255.0, 12h dhcp-range=fec0::ff00, fec0::fffe/10, 12h enable-ra dhcp-option-force=26,1397 log-queries log-dhcp conf-dir=/etc/dnsmasq.d # glance at the dnsmasq log when i make a DHCP request hostapd: wlan0: STA 88:53:2e:65:8c:a4 IEEE 802.11: associated hostapd: wlan0: STA 88:53:2e:65:8c:a4 RADIUS: starting accounting session 56703A6F-00000010 hostapd: wlan0: STA 88:53:2e:65:8c:a4 WPA: pairwise key handshake completed (RSN) dnsmasq-dhcp[3585]: 2738259568 available DHCP range: 192.168.233.100 -- 192.168.233.200 dnsmasq-dhcp[3585]: 2738259568 client provides name: anri dnsmasq-dhcp[3585]: 2738259568 DHCPREQUEST(wlan0) 192.168.233.200 88:53:2e:65:8c:a4 dnsmasq-dhcp[3585]: 2738259568 tags: wlan0 dnsmasq-dhcp[3585]: 2738259568 DHCPACK(wlan0) 192.168.233.200 88:53:2e:65:8c:a4 anri dnsmasq-dhcp[3585]: 2738259568 requested options: 1:netmask, 28:broadcast, 2:time-offset, 3:router, dnsmasq-dhcp[3585]: 2738259568 requested options: 15:domain-name, 6:dns-server, 119:domain-search, dnsmasq-dhcp[3585]: 2738259568 requested options: 12:hostname, 44:netbios-ns, 47:netbios-scope, dnsmasq-dhcp[3585]: 2738259568 requested options: 26:mtu, 121:classless-static-route, 42:ntp-server, dnsmasq-dhcp[3585]: 2738259568 requested options: 121:classless-static-route, 249, 33:static-route, dnsmasq-dhcp[3585]: 2738259568 requested options: 252, 42:ntp-server dnsmasq-dhcp[3585]: 2738259568 next server: 192.168.233.254 dnsmasq-dhcp[3585]: 2738259568 sent size: 1 option: 53 message-type 5 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 54 server-identifier 192.168.233.254 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 51 lease-time 43200 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 58 T1 21600 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 59 T2 37800 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 1 netmask 255.255.255.0 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 28 broadcast 192.168.233.255 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 3 router 192.168.233.254 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 6 dns-server 192.168.233.254 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 12 hostname anri dnsmasq-dhcp[3585]: 2738259568 sent size: 2 option: 26 mtu 1397 dnsmasq-dhcp[3585]: RTR-SOLICIT(wlan0) dnsmasq-dhcp[3585]: 2738259568 available DHCP range: 192.168.233.100 -- 192.168.233.200 dnsmasq-dhcp[3585]: 2738259568 client provides name: anri dnsmasq-dhcp[3585]: 2738259568 DHCPREQUEST(wlan0) 192.168.233.200 88:53:2e:65:8c:a4 dnsmasq-dhcp[3585]: 2738259568 tags: wlan0 dnsmasq-dhcp[3585]: 2738259568 DHCPACK(wlan0) 192.168.233.200 88:53:2e:65:8c:a4 anri dnsmasq-dhcp[3585]: 2738259568 requested options: 1:netmask, 28:broadcast, 2:time-offset, 3:router, dnsmasq-dhcp[3585]: 2738259568 requested options: 15:domain-name, 6:dns-server, 119:domain-search, dnsmasq-dhcp[3585]: 2738259568 requested options: 12:hostname, 44:netbios-ns, 47:netbios-scope, dnsmasq-dhcp[3585]: 2738259568 requested options: 26:mtu, 121:classless-static-route, 42:ntp-server, dnsmasq-dhcp[3585]: 2738259568 requested options: 121:classless-static-route, 249, 33:static-route, dnsmasq-dhcp[3585]: 2738259568 requested options: 252, 42:ntp-server dnsmasq-dhcp[3585]: 2738259568 next server: 192.168.233.254 dnsmasq-dhcp[3585]: 2738259568 sent size: 1 option: 53 message-type 5 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 54 server-identifier 192.168.233.254 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 51 lease-time 43200 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 58 T1 21600 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 59 T2 37800 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 1 netmask 255.255.255.0 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 28 broadcast 192.168.233.255 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 3 router 192.168.233.254 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 6 dns-server 192.168.233.254 dnsmasq-dhcp[3585]: 2738259568 sent size: 4 option: 12 hostname anri dnsmasq-dhcp[3585]: 2738259568 sent size: 2 option: 26 mtu 1397 

你在configuration中犯了一些不同的错误。 首先,站点本地地址已被弃用多年。 任何文档告诉你使用以fec0开头的地址是过时的,需要更新。

站点本地地址的replace称为唯一本地地址。 这些是通过使用fd作为第一个八位组,然后是五个随机八位组。 例如,您可以将fdda:772b:1c61::/48作为您的本地前缀。

但是,上面提到的这两种types的地址都不适用于要与自己的networking之外的任何内容进行通信的计算机。 如果您希望这些计算机在您自己的networking之外进行通信,则应该从您的ISP路由到您的前缀中分配地址。

另外对于使用DHCPv6的许多情况来说,这不是最好的select。 这取决于您的具体需求,但通常只使用路由器通告守护进程(如radvd )是比DHCPv6服务器更合适的select。