How do I assign static IPv6 address to devices from the router?

I get my ::/64 IPv6 prefix from my ISP which then gets advertised to my local network. Each device gets their own IPv6, using SLAAC of course. While I can set a custom IP for every computer easily, it is not so easy to do for IoT devices, smartphones or other smart devices. It is easy to set a custom IP on a computer but how do you do it on a random smart gadget? Often there is not way to set a custom IP.

It would be nice to be able to map a MAC address of a device to a specific custom IP or to make the existing one static. That was possible with IPv4 and DHCP but since IPv6 uses SLAAC and it is recommended to use SLAAC because some devices like Android phones only support SLAAC then how do we assign a static IP address using SLAAC?

Here is the IPv6 prefix that I get from my ISP:

// IPv6 > Addresses
enabled:    yes
address:    2a01:ec12:b201:cc5e::/64
interface:  bridge
eu64:       no
advertise:  yes
no dad:     no
valid:      01:00:00
preferred:  00:30:00

For example, these are the IPs that devices have received on my network. And for example, I would like to give my Smart plug a custom, static address but I would like to do it from the router because there is no interface or GUI or settings on the smart plug to specify a custom IP.

// Laptop
2a01:ec12:b201:cc5e:38d1:c3ff:fe22:8b71

// Smart plug
2a01:ec12:b201:cc5e:43e1:4eff:23ef:8b71

// Android phone
2a01:ec12:b201:cc5e:4e1d:2efd:e21d:1bde

Read this. It not only describes one common way to get exactly what you ask for, it links to the reasons not all IPv6 devices do that.

Reflashing proprietary smart plugs with ESPHome and similar isn’t the only option. A lot of these things use mDNS to announce themselves by name, so you no longer need to know a static IP to communicate with it.

This is mission “nearly impossible”. One issue is DHCPv6 server on ROS … it doesn’t support giving out IPv6 addresses, it only hands out prefixes (there are some recent activities which may improve DHCPv6 server by adding address assignment functionality). And the big issue is client support: there are many clients which simply don’t use DHCPv6 protocol to obtain address (and related information) but insist on using SLAAC (with pseudo-random address “invention”). One huge family of such devices is Android smart devices. And with SLAAC tehre’s no way of forcing device to assume any particular IP address.

What often (but not always) happens: device derives IPv6 address based on own MAC address (EUI-64 mechanizm) … and then also derives a random IPv6 address based on prefix. Device then uses that random address for outgoing connections. After a while (tens of minutes) it derives another random address and starts using the new address for new connections (but keeps using the old address for existing connections). And after a while it derives yet another address … etc. However, the “cosntant” address is always available for ingress connections.
On devices which use both mechanizms (DHCPv6 and SLAAC), device acquires one IPv6 address using DHCPv6 client and that’s the address which is the constant. But device still uses SLAAC mechanizm of deriving random addresses … This is how Windows10 behave.
And there are devices which which don’t use SLAAC if DHCPv6 provides all necessary information.

The only constant in IPv6 addressing is use of link-local addresses, which is just fine for communication within certain IPv6 subnet (they can’t be routed). Process of deriving link-local addresses is not cast into stone, but most devices fall back to EUI-64 addressing … which most of times gives possibility to work around the IPv6-constrains of individual devices.

Not directly a reply, but can solve your ploblem.
http://forum.mikrotik.com/t/my-isp-gives-me-only-64-ipv6-prefix-how-do-i-create-multiple-subnets/180205/3