How to configure a static IPv6 address in dhcp

How should I bind an IPv6 address to a MAC?

I want to allow my 3 computers to access each other with an easy-to-remember IP address on the LAN.
Instead of "99d" "a7b"

I tried setting it under cgi-bin/luci/admin/network/arpbind but it doesn't work,

I also tried setting DHCP in /cgi-bin/luci/admin/network/dhcp, but it also doesn't work.

Maybe I misunderstood "address suffix"

Now they are assigned like this:

IPv6 doesn't use ARP.
These settings are enough for me. Under DHCP

and under the LAN interface:

I noticed that my DHCP settings are missing a column compared to yours. In your picture, the second column from the right is the device's DUID?
Maybe I am missing a package or missing updates.
Maybe I can adjust the config file directly, or use the command to set it.

That's right!

Which Device do you have and which version of Openwrt are you running?

1 Like

Sorry, I am not using normal openwrt because it contains closed source drivers.
I know my Dnsmasq version 2.77

I don't know if that is relevant, but my version is 2.80

Thank you very much, I will try to risk updating it.
However, I did not find the relevant content in the update log.

You should look at odhcpd, which is the responsible DHCPv6 in Openwrt. Version is 1.15-3

1 Like

Wouldn't you just assign the IP to the client?

Perhaps I'm missing what the user wishes to do. Static addresses are configured on clients, not servers.

Using DHCPv6, as @trendy noted...but this isn't "static addressing" as your title and first post implies you wish to do.


There are multiple ways for clients to get IPv6 addresses, if your client isn't using DHCPv6 then none of the DHCPv6 settings will have any effect.

some of the possibilities are:

  1. SLAAC with MAC based address
  2. Privacy addresses
  3. Stable Privacy addresses
  4. DHCPv6
  5. Statically configured addresses

Many clients use more than one strategy.

A good solution for your use case might be to configure a static address on your client, and then put the address in the /etc/hosts file so that DNSmasq knows about, and just use the hostname.


Thanks, I flashed the latest firmware for openwrt
OpenWrt 18.06.2 r7676-cddd7b4c77 / LuCI openwrt-18.06 branch (git-19.020.41695-6f6641d) (it does not have a wireless driver, but does not affect the other)
And found the missing configuration.
I set it up.

[del]However, it is still not possible to set an IPv6 address.[/del]
After a long reboot, it worked, I saw the IP address I wanted.

Can't actually be configured on the server, even with DHCPv6? Because ipv4 can, so I guess ipv6 can also.
I thought it would be more difficult to configure on the client.

Sure you can with DHCPv6, I noted that already:

Untrue - unless DHCPv4 is used too.

In any case I've always assigned a static IP on the client. Perhaps I misunderstand what you desire to do. It seems you want to RESERVE A DHCP-issued IP in the DHCP server, NOT assign a static address to a client.

I want to assign a static address to my computers.
Now it works.

I'm glad you made a static assignment in your DHCP server for both IPv4 and IPv6.

Apologies for the confusion.

It does use Neighbor Discovery Protocol. So, if you simply assign a static IP on the client (within the ULA prefix), there won't be conflicts.

1 Like

Thanks, but I don't understand how to assign multiple ipv6 addresses on the client so that one of the addresses is static and the other is dynamic.

It depends on the client, but you can have multiple ipv6 addresses on one interface. As long as the router is sending RA, you can have the SLAAC address. If there is DHCPv6 you can also run a dhcp6c on the client. And of course you can assign a static IP by yourself.

@vgaetera I believe he means hosts connected to the Openwrt router, not multiple address on the interface of the Openwrt.

1 Like