OpenWrt Forum Archive

Topic: LuCI - Hostnames for DHCPv6 leases?

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

I use LuCI to configure my OpenWrt router. I've recently used the tool under Network -> DHCP and DNS -> Static Leases to configure static leases and custom hostnames for all of the hosts on my network. I have provided the hostname, MAC address, and designated IP address for each host. On this same page, under Active DHCP Leases, I can see a list of all of the currently active DHCP Leases, including my designated hostnames for each one, but for the Active DHCPv6 Leases, no hostnames are showing up. That section looks like this:

Active DHCPv6 Leases
Hostname    IPv6-Address    DUID    Leasetime remaining
?    fd93:cbd6:157d::7af/128    000100011d2468810022413ae65c    10h 17m 41s
?    fd93:cbd6:157d::a8b/128    000100011b0ba1a180006e5ca045    3h 8m 40s
?    fd93:cbd6:157d::e92/128    000100011d63bafd68ae205b266f    9h 53m 1s


Any idea how I can get the same hostnames that show in the Active DHCP Leases section to show up in the Active DHCPv6 Leases section? Does it have anything to do with the IPv6 Suffix field? I haven't filled this in since I'm not sure what to put there.

Here's my system info:

Model    TP-Link TL-WDR3600 v1
Firmware Version    OpenWrt Chaos Calmer 15.05 / LuCI (git-15.248.30277-3836b45)
Kernel Version    3.18.20

(Last edited by prwood on 22 Jan 2016, 22:20)

Hi all. Just wanted to bump this up to see if anybody had ideas or suggestions on this.

I have also defined static ipv4 leases for my PCs, phones etc. in /etc/config/dhcp. And I see the hostname properly in the dhcpv6 section.
Also my other router in LAN gets its hostname shown ok.

Lumia635 (192.168.1.210)
   2001:14ba:8874:6600::210/128 fd1b:7654:3210::210/128    00010...f6b0    11h...48s
OpenWrt2
   2001:14ba:8874:6600::e94/128 fd1b:7654:3210::e94/128    000300...36    9h...58s

But this is from DD trunk, not CC15.05

The relevant config items in /etc/config/dhcp:

config 'dhcp' 'lan'
        option 'interface' 'lan'
        option 'start' '100'
        option 'limit' '150'
        option 'leasetime' '12h'
        option 'force' '1'
        option dhcpv6 'server'
        option ra 'server'
        list dhcp_option '252,"\n"'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

You both need to set the DUID for the device in your /etc/config/dhcp in order for it to recognize the device.

the lines you will add under the 'config host' section corresponding to the host you wish to configure are:

config duid '00010...f6b0' 
config hostid '210'

duid corresponds to the duid listed on your screen. hostid corresponds to the ipv6 suffix you wish for the device to have.

A note about the DUID -- the DUID is built automatically either based on the LINK LAYER address (the MAC address of the device) or, a combination of the MAC address and the current time. Your host OS may allow you to configure this so that the DUID presented to your router is consistent and so that the router assigns the proper addresses.

cmeu wrote:

You both need to set the DUID for the device in your /etc/config/dhcp in order for it to recognize the device.

the lines you will add under the 'config host' section corresponding to the host you wish to configure are:

config duid '00010...f6b0' 
config hostid '210'

duid corresponds to the duid listed on your screen. hostid corresponds to the ipv6 suffix you wish for the device to have.

A note about the DUID -- the DUID is built automatically either based on the LINK LAYER address (the MAC address of the device) or, a combination of the MAC address and the current time. Your host OS may allow you to configure this so that the DUID presented to your router is consistent and so that the router assigns the proper addresses.

If I add these options, then restart dnsmasq, how long should I expect before it takes effect and I'm able to see the hostnames under the DHCPv6 section? Does it not take effect until the leases in question are renewed or the router is rebooted? I'm asking because I've made this change and don't see a difference in the DHCPv6 hostname.

prwood wrote:
cmeu wrote:

You both need to set the DUID for the device in your /etc/config/dhcp in order for it to recognize the device.

the lines you will add under the 'config host' section corresponding to the host you wish to configure are:

config duid '00010...f6b0' 
config hostid '210'

duid corresponds to the duid listed on your screen. hostid corresponds to the ipv6 suffix you wish for the device to have.

A note about the DUID -- the DUID is built automatically either based on the LINK LAYER address (the MAC address of the device) or, a combination of the MAC address and the current time. Your host OS may allow you to configure this so that the DUID presented to your router is consistent and so that the router assigns the proper addresses.

If I add these options, then restart dnsmasq, how long should I expect before it takes effect and I'm able to see the hostnames under the DHCPv6 section? Does it not take effect until the leases in question are renewed or the router is rebooted? I'm asking because I've made this change and don't see a difference in the DHCPv6 hostname.

Yep, when the lease is assigned it will reflect the host. Carefully watch the DUID being used. If the client isn't providing the router with a consistent DUID you'll need to configure the client to do so.

foolproof method: restart the router & restart the client. Should see it assigned correctly.

(Last edited by cmeu on 8 Feb 2016, 01:01)

The discussion might have continued from here.