You are not logged in.
I'm using hostapd to create wifi access point. And the 'create_ap' script(hostapd+nat+dnsmasq) is very helpful. But i also want to use IPV6 network on my mobile phone for some reasons. I have tried to follow the article Hostapd + DHCPV6 + IPV6 + Ubuntu 13.04. But i didn't make it.
And i am a little confused about the dhcp-range & dhcp-host of IPV6 in /etc/dnsmasq.conf. the ipv6 address in the section & DUID can be set casually?
Any idea? thanks.
Offline
I got mine working with hostapd + dhcpcd + radvd. In my case, the access point is also the router, so dhcpcd gets an ia_pd (delegated prefix) from my ISP and configures the lan interface with an address from that prefix. The prefix is then advertised by radvd.
If your access point is not configured as a router then it must bridge the wireless and the wired interface, and a router on the same subnet must be sending advertisements. If your router gets a delegated prefix it can advertise a /64 and your phone will do SLAAC. If you just have a set of addresses then your router advertisments should have the AdvManagedFlag set which tells hosts to get their addresses over dhcp6; in this case you will of course also need a dhcp6 server running.
If you can describe your network topology and give more specifics on what is/not working maybe we can help more. Some info that would be helpful:
* Is the access point also a router? If not, is it bridged?
* Does the router (whether same box or not) get a delegated prefix? If so, does it advertise the prefix and have an address from the prefix configured on it's lan port?
* Is the access point working for IPv4? hostapd does not care about IPv4 or IPv6, so if it is working with IPv4 you just have an IPv6 configuration issue not an access point issue.
* Is IPv6 working on any hosts on the wired network? If so, how are they configured?
Offline
I got mine working with hostapd + dhcpcd + radvd. In my case, the access point is also the router, so dhcpcd gets an ia_pd (delegated prefix) from my ISP and configures the lan interface with an address from that prefix. The prefix is then advertised by radvd.
If your access point is not configured as a router then it must bridge the wireless and the wired interface, and a router on the same subnet must be sending advertisements. If your router gets a delegated prefix it can advertise a /64 and your phone will do SLAAC. If you just have a set of addresses then your router advertisments should have the AdvManagedFlag set which tells hosts to get their addresses over dhcp6; in this case you will of course also need a dhcp6 server running.
If you can describe your network topology and give more specifics on what is/not working maybe we can help more. Some info that would be helpful:
* Is the access point also a router? If not, is it bridged?
* Does the router (whether same box or not) get a delegated prefix? If so, does it advertise the prefix and have an address from the prefix configured on it's lan port?
* Is the access point working for IPv4? hostapd does not care about IPv4 or IPv6, so if it is working with IPv4 you just have an IPv6 configuration issue not an access point issue.
* Is IPv6 working on any hosts on the wired network? If so, how are they configured?
Thank you for your specific reply. The questions,
* I am running hostapd in nat mode(using iptables) on my laptop
* A delegated prefix? I guess so, like 2001:xx:xx:xx:1/64? I am not sure. And I just know a little about IPv6 actually.
* yes, the access point works very well for IPv4. And I can use dnsmasq to manipulate the access point easily, like ip address assignment, mac restriction etc. As I said, I try to follow the Hostapd + DHCPV6 + IPV6 + Ubuntu 13.04. Unfortunately, I failed.
* I am using IPv6 on the wired network, under "IPv6-in-IPv4" tunnel mode(sit mode of iptunnel) .
Is it possible to use hostapd+dnsmasq+iptables just like the article said? or if i use radvd, how should i set up on my laptop? using hostapd+dnsmasq+iptables+radvd?
Offline
Ok, so you have a 2001:xx:xx:xx::/64 prefix assigned by your tunnel broker, not a delegated prefix. This make it a little easier since your prefix is static.
To answer your specific dnsmasq config questions:
* dhcp-host is just a way to assign a specific address to a specific host. To do this, the host must be identifiable. DHCPv6 uses the DUID to identify the host for this purpose, so no, it cannot be set casually. For this feature to work, it must match the DUID that the host sends in its dhcp requests. If it is wrong the host will get a random address from the dhcp-range if one is configured.
* dhcp-range is a range of addresses from your prefix to dynamically assign, but it also has options to enable SLAAC or SLAAC+dhcp. The dnsmasq man page has an extensive description of this option.
If you have enable-ra in your dnsmasq as the guide you reference suggests, then dnsmasq should be sending router advertisements and you do not need radvd.
It sounds like you have all of the pieces in place. If you are still having trouble, using tcpdump on the wireless interface to capture all ICMPv6 (for NDP and RS/RA) and DHCPv6 packets can give you invaluable information with regards to what is/not working.
Offline
Ok, so you have a 2001:xx:xx:xx::/64 prefix assigned by your tunnel broker, not a delegated prefix. This make it a little easier since your prefix is static.
To answer your specific dnsmasq config questions:
* dhcp-host is just a way to assign a specific address to a specific host. To do this, the host must be identifiable. DHCPv6 uses the DUID to identify the host for this purpose, so no, it cannot be set casually. For this feature to work, it must match the DUID that the host sends in its dhcp requests. If it is wrong the host will get a random address from the dhcp-range if one is configured.
* dhcp-range is a range of addresses from your prefix to dynamically assign, but it also has options to enable SLAAC or SLAAC+dhcp. The dnsmasq man page has an extensive description of this option.If you have enable-ra in your dnsmasq as the guide you reference suggests, then dnsmasq should be sending router advertisements and you do not need radvd.
It sounds like you have all of the pieces in place. If you are still having trouble, using tcpdump on the wireless interface to capture all ICMPv6 (for NDP and RS/RA) and DHCPv6 packets can give you invaluable information with regards to what is/not working.
I have tested on android. It seems that I can not see any other IPv6 address except the "IPv6 Link-Local" type. And I got no reply or got " Network is unreachable" when ping6 on my android. The data using wireshark shows the ICMPv6 packets are sending between my android local IPv6 address and the wlan0ap's local IPv6 address(the access point created on my laptop). So, what's the problem?
PS: I just modified the dnsmasq configuration in create_ap script as below,
interface=${WIFI_IFACE}
bind-interfaces
dhcp-range=${GATEWAY%.*}.1,${GATEWAY%.*}.254,255.255.255.0,24h
dhcp-range=2001:da8:200:900e::2,2001:da8:200:900e::10,24h
enable-ra
And the wlan0ap have a default IPv6 address fe80::5e51:4fff:feb7:8914 which is generated by the script.
Last edited by tsyijiu (2014-04-12 09:47:36)
Offline