Skip to content

Instantly share code, notes, and snippets.

@rikka0w0
Last active September 12, 2020 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rikka0w0/09bc49b68201551bd0d0f4a1ca2c1e0f to your computer and use it in GitHub Desktop.
Save rikka0w0/09bc49b68201551bd0d0f4a1ca2c1e0f to your computer and use it in GitHub Desktop.
Fix the IPv6 ULA(LAN) address

Enable IPv6 DHCP client

  1. Edit /etc/network/interfaces, change or append: iface ??? inet6 dhcp where ??? is your interface name, e.g. eth0 or enp12s0, and then reboot.

Find your current DUID

The DUID is used by the router to assign ULA(LAN) ipv6 addresses to clients, similar to how ipv4 DHCP server assign ipv4 addresses based on MAC. To find out your current DUID, follow these steps:

  1. Run cat /var/lib/dhcp/dhclient6.???.leases | grep default-duid, replace ??? with the name of your network interface, e.g. eth0 or enp12s0.
  2. Copy the output from the previous command, remove the default-duid prefix and the tailing ;. Use the remaining string for the next command.
  3. Run printf "???" | hexdump -e '14/1 "%02x " "\n"' | sed 's/ /:/g', the output is your current DUID in human-readable form.

Set your DUID to a fixed or known value

  1. Edit /etc/systemd/networkd.conf, uncomment and set DUIDRawData=
  2. Reboot

References

  1. http://manpages.ubuntu.com/manpages/bionic/man5/networkd.conf.5.html
  2. https://askubuntu.com/questions/712159/how-can-i-find-out-my-systems-dhcpv6-duid
  3. https://redhatlinux.guru/2019/07/01/find-duid-on-rhel-and-centos-servers/
  4. https://askubuntu.com/questions/1198955/how-can-i-change-my-ubuntus-ipv6-duid
  5. https://www.jumpingbean.co.za/blogs/mark/set-up-ipv6-lan-with-linux
  6. https://askubuntu.com/questions/616856/how-do-i-add-an-additional-ipv6-address-to-etc-network-interfaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment