OpenWrt Forum Archive

Topic: DHCPv6-PD for IPv6 configuration

The content of this topic has been archived on 17 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

I just installed OpenWRT 10.3-rc5 on my D-Link DIR-825 and everything works great so far. I configured wifi settings, ppoe to connect to the internet, mac filtering etc. However I'm having some trouble with my IPv6 configuration. My provider offers dual-stack IPv4/IPv6 and I don't seem to be able to configure the LAN side properly.

I can check from the web interface that the WAN side gets an /64 IPv6 address from my provider over ppoe (it has a global and a link-local ipv6 address). I also enabled radvd for the LAN side. However, my LAN side only has a link-local IPv6 address and the computers on the LAN don't get an IPv6 address. I have not configured a manual IPv6 address on the LAN side since my provider gives me a different one every time the ppoe connection is established, much like the IPv4 address.

With the stock D-link firmware (v. 2.05EU) I was able to use DHCP-PD to relay the IPv6 address of the WAN side to the LAN side. Can anyone provide some information on how to do the same (or something similar) with OpenWRT? I've installed the wide-dhcpv6 server and client packages and messed with that configuration to no avail.

Any help will be much appreciated!  Thanks in advance.

Hm, wide-dhcpv6-client is supposed to take care of that. In /etc/config/dhcp6c, set the "enabled" option to "1", run "/etc/init.d/dhcp6c enable" and "/etc/init.d/dhcp6c restart". Eventually a global IPv6 prefix should appear on br-lan. If not, check "logread" and look for related messages. If a prefix was successfully acquired, the dhcp6c client takes care of restarting radvd to make it aware of the new lan prefix. You just have to configure (=enable) radvd in advance.

Thanks for the reply, jow. I followed your suggestion but I still can't get a global v6 address on br-lan.

I'm a bit confused regarding the dhcpv6 client configuration. I gather that the client should talk to a dhcpv6 server to get the information, right? Which server would that be? A wide-dhcpv6-server I should run on the wan? Or the dhcpv6 server that (I guess) my ISP runs?

In the former case, I don't know how to configure the wide-dhcpv6 server on the wan because all examples I found need a static address range. Since my ISP gives me a different v6 address every time pppoe is established, I don't have a static range. Can I configure it so that it gets the range from the prefix of the wan interface? If so, how?

In the latter case, I'm not sure but I don't think that my ISP runs a dhcpv6 server since I was able to get the v6 address on wan even before I installed the wide-dhcpv6 server and client packages. Is dhcpv6 involved when I get the v6 address on pppoe? I didn't think so. If so, do I need any special configuration for the dhcp client?

I've disabled the wide-dhcpv6 server and left only with the client. I have a global v6 address on the wan interface but only a link-local on the br-lan. Just for reference, here's my dhcpv6 client configuration:

config 'dhcp6c' 'basic'                                                                                                                                  
        option 'enabled' '1'                            # 1 = enabled; 0 = disabled                                                                      
        option 'interface' 'lan'                        # This is the interface the DHCPv6 client will run on                                            
        option 'dns' 'dnsmasq'                          # Which DNS server you run (only dnsmasq currently supported)                                    
        option 'debug' '0'                              # 1 = enable debugging; 0 = disable debugging                                                    
                                                                                                                                                         
        # Send options (1 = send; 0 = do not send)                                                                                                       
        option 'pd' '1'                                 # Prefix Delegation                                                                              
        option 'na' '0'                                 # Non-Temporary Address                                                                          
        option 'rapid_commit' '1'                       # Rapid Commit                                                                                   
                                                                                                                                                         
        # Request options (1 = request; 0 = do not request)                                                                                              
        option 'domain_name_servers' '1'                                                                                                                 
        option 'domain_name' '0'                                                                                                                         
        option 'ntp_servers' '0'                                                                                                                         
        option 'sip_server_address' '0'                                                                                                                  
        option 'sip_server_domain_name' '0'                                                                                                              
        option 'nis_server_address' '0'                                                                                                                  
        option 'nis_domain_name' '0'                                                                                                                     
        option 'nisp_server_address' '0'                                                                                                                 
        option 'nisp_domain_name' '0'                                                                                                                    
        option 'bcmcs_server_address' '0'                                                                                                                
        option 'bcmcs_server_domain_name' '0'                                                                                                            
                                                                                                                                                         
        # Override the used DUID, by default it is derived from the interface MAC                                                                        
        # The given value must be uppercase and globally unique!                                                                                         
        #option 'duid' '00:03:00:06:D8:5D:4C:A5:03:F2'                                                                                                   
                                                                                                                                                         
        # Script to run when a reply is received                                                                                                         
        #option 'script' '/usr/bin/dhcp6c-state'                                                                                                         
                                                                                                                                                         
# Define one or more interfaces on which prefixes should be assigned                                                                                     
config 'interface' 'loopback'                                                                                                                            
        option 'enabled' '1'                            # 1 = enabled; 0 = disabled                                                                      
        option 'sla_id' '0'                             # Site level aggregator identifier specified in decimal (subnet)                                 
        option 'sla_len' '1'                            # Site level aggregator length (64 - size of prefix being delegated)                             
                                                        # e.g. /60 from ISP -> 64 - 60 = 4                                                               
                                                                                                                                                         
config 'interface' 'lan'                                                                                                                                 
        option 'enabled' '1'                                                                                                                             
        option 'sla_id' '1'                                                                                                                              
        option 'sla_len' '1'

Here's the only relevant output I could find from logread after doing a reboot and then a restart of the dhcp6c:

root@OpenWrt:/etc/config# logread | grep 6c
Mar 27 02:44:03 OpenWrt user.notice dhcp6c: starting dhcp6c
Mar 27 02:44:04 OpenWrt user.notice dhcp6c: Using MAC address DUID 00:03:00:06:00:18:xx:xx:xx:xx
Oct 23 07:42:24 OpenWrt user.notice dhcp6c: stopping dhcp6c
Oct 23 07:42:24 OpenWrt user.notice dhcp6c: starting dhcp6c
Oct 23 07:42:24 OpenWrt user.notice dhcp6c: Using MAC address DUID 00:03:00:06:00:18:xx:xx:xx:xx
root@OpenWrt:/etc/config#

At the bottom of the kernel log I noticed a line that says "no IPv6 routers present" for eth1, which is the wan interface. I'm not sure why, I used to connect with IPv6 so I guess the ISP's configuration is ok.

(...) device wlan0 entered promiscuous mode
br-lan: port 2(wlan0) entering forwarding state
device wlan0 left promiscuous mode
br-lan: port 2(wlan0) entering disabled state
device wlan0 entered promiscuous mode
br-lan: port 2(wlan0) entering forwarding state
eth1: no IPv6 routers present
ar71xx-wdt: enabling watchdog timer

Maybe there's some configuration I'm missing?

(Last edited by mikem4600 on 23 Oct 2011, 09:10)

After looking into the actual wide-dhcp6c configuration in /var/etc/dhcp6c.conf I was finally able to fix my issue.

I had to change the /etc/config/dhcp6c configuration the interface to: option 'interface' 'wan' in the config 'dhcp6c' 'basic' section. However, after I did that, my ISP was immediately terminating the connection as soon as it was established. So I also had to add the following section:

config 'interface' 'wan'
        option 'enabled' '0'

Now my configuration in /etc/config/dhcp6c is:

config 'dhcp6c' 'basic'
        option 'enabled' '1'                            # 1 = enabled; 0 = disabled
        option 'interface' 'wan'                        # This is the interface the DHCPv6 client will run on
        option 'dns' 'dnsmasq'                                # Which DNS server you run (only dnsmasq currently supported)
        option 'debug' '0'                              # 1 = enable debugging; 0 = disable debugging

        # Send options (1 = send; 0 = do not send)
        option 'pd' '1'                                 # Prefix Delegation
        option 'na' '0'                                 # Non-Temporary Address
        # option 'rapid_commit' '1'                     # Rapid Commit

        # Request options (1 = request; 0 = do not request)
        option 'domain_name_servers' '1'
        option 'domain_name' '0'
        option 'ntp_servers' '0'
        option 'sip_server_address' '0'
        option 'sip_server_domain_name' '0'
        option 'nis_server_address' '0'
        option 'nis_domain_name' '0'
        option 'nisp_server_address' '0'
        option 'nisp_domain_name' '0'
        option 'bcmcs_server_address' '0'
        option 'bcmcs_server_domain_name' '0'

        # Override the used DUID, by default it is derived from the interface MAC
        # The given value must be uppercase and globally unique!
        #option 'duid' '00:03:00:06:D8:5D:4C:A5:03:F2'

        # Script to run when a reply is received
        # option 'script' '/usr/bin/dhcp6c-state'

# Define one or more interfaces on which prefixes should be assigned
config 'interface' 'loopback'
        option 'enabled' '1'                            # 1 = enabled; 0 = disabled
        option 'sla_id' '0'                             # Site level aggregator identifier specified in decimal (subnet)
        option 'sla_len' '8'                            # Site level aggregator length (64 - size of prefix being delegated)
                                                        # e.g. /60 from ISP -> 64 - 60 = 4

config 'interface' 'wan'
        option 'enabled' '0'

config 'interface' 'lan'
        option 'enabled' '1'
        option 'sla_id' '1'
        option 'sla_len' '8'

hi,have you solved your problem. i'm doing the same work recently. saddly with no progress.

The discussion might have continued from here.