IPv6 Token
In rebuilding my servers with a newer os, I had to review how to set an IPv6 token. The 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?
The first thing to know is that the OS uses a 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
4
nmcli connection modify eno0 ipv6.method "auto"
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 prefix does not change from my provider the address is as good as a static one.
Edit/Update
I added one line to connection modification to set the method to auto. Also I recently (2024-08) I noted my devices were having issues persisting this across reboots. I had some “ghost” network connections so I purged them. I still had issues and I had to check for other false config files.
1
cd /etc/NetworkManager/system-connections/
Should only have your interfaces and nothing else. To be sure things are setup right if you cat out the contents of the interface it should contain the following.
1
2
3
4
[ipv6]
addr-gen-mode=eui64
method=auto
token=::dead:beaf