Static DHCPv6 leases in OpenWrt

I’ve updated my router’s fimware to latest version of OpenWrt, and there are great improvements everywhere. The one I like more is the overhaul of the IPv6 configuration, with the new daemon odhcpd and the automatic prefix delegation. You can consult the details in the wiki.

However, I’ve found one caveat trying to configure a client to have a static DHCPv6 lease. After asking in the forums, I found the solution: First, the client has to obtain an IP by DHCPv6, that way the DUID of the client is registered in /var/hosts/odhcpd. Then, the DUID has to be added to /etc/config/dhcp.

Here is an example in which I’m reserving the IP <prefix>::2 to a DUID.

/etc/config/dhcp:

config host
 option name 'server'
 option mac 'aa:bb:cc:dd:ee:ff'
 option ip '192.168.100.2'
 option duid '0008b4b2578a123c3e9f3a387b123e297864343ab32f'
 option hostid '00000002'
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s