In rebuilding my servers with a newer os, I had to review how to set an IPv6 token. First thing that you may be asking yourself is what is an IPv6 token exactly? To keep it very simple it allows for the first part/half of the address to be dynamic while the second part/half is something you can assign statically. This is helpful for me as I can have shorter addresses for the server systems and full length ipv6 addresses for systems and devices that have no interface to them. So how does one do this in Rocky Linux 9?
First thing to know is that the OS uses network manager, so work will be done with the ever so fun nmcli command. Second we need to know the interface name, I am going to assume you the reader can find that and my example will use eno1.
1 2 3 nmcli connection modify eno1 ipv6.addr-gen-mode eui64 nmcli connection modify eno1 ipv6.token ::dead:beaf systemctl restart NetworkManager.service
Which nets us the desired result of something like (modifed output):
1 2 3 4 5 6 7 8 9 10 [root@zeusjr ~]# ip addr show dev eno1 8: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 11:22:33:cc:bb:aa brd ff:ff:ff:ff:ff:ff inet 100.64.100.64/23 brd 100.64.101.255 scope global dynamic noprefixroute eno1 valid_lft 3597sec preferred_lft 3597sec inet6 2606:2606:2606:2606::dead:beaf/64 scope global dynamic noprefixroute valid_lft 86399sec preferred_lft 14399sec inet6 fe80::ab8f:dfde:b875:eacf/64 scope link noprefixroute valid_lft forever preferred_lft forever [root@zeusjr ~]#
Now when I reboot and as long as the prefex does not change from my provider the address is as good as a static one.