4

I have just implemented my own DynDNS service that updates the AAAA records with my DNS provider using an IPv6 prefix and a bunch of MAC addresses of LXD container macvlan interfaces. This works well.

Now I wanted to do the same with a few client machines on the network, but it seems that my Kubuntu 20.04 notebook does not generate its IPv6 address from EUI-64. Indeed, /proc/sys/net/ipv6/conf/enp0s31f6/addr_gen_mode contains 1. I do not quite understand what this means, but the resulting address is not made from the MAC in any obvious way.

I echoed 0 into the file and also set

net.ipv6.conf.default.addr_gen_mode = 0
net.ipv6.conf.enp0s31f6.addr_gen_mode = 0

in /etc/sysctl.conf, but as soon as I disable and reenable the connection via NetworkManager, /proc/sys/net/ipv6/conf/enp0s31f6/addr_gen_mode is back to 1. What is causing this behavior?

7
  • 1
    systemd-networkd and probably /etc/sysctl.d/40-ipv6.conf Please do not use old editing methods on systemd systems, systemd has its own configuration.
    – Rinzwind
    Aug 21, 2020 at 8:59
  • Hm, there is no such file and the other don't contain it. There is actually even a soft link from 99-sysctl.conf to /etc/sysctl.conf.
    – mcandril
    Aug 25, 2020 at 12:26
  • freedesktop.org/software/systemd/man/systemd.network.html says that if IPv6LinkLocalAddressGenerationMode isn't set, then the kernel default is used. I don't see it set anywhere, but something is messing with the kernel default from sysctl.
    – mcandril
    Aug 25, 2020 at 12:27
  • 1
    Might it be the same as github.com/systemd/systemd/issues/15465 ? Oh and did you check for /etc/sysctl.d/40-ipv6.conf or /etc/sysctl.d/*-ipv6.conf? The 40 is for execution order and could be another number.
    – Rinzwind
    Aug 25, 2020 at 12:56
  • Could be. Yes, I don't have such a file. The only ipv6 related filenam is 10-ipv6-privacy.conf. I also grep'ed the whole directory for that config. That one file contains net.ipv6.conf.all.use_tempaddr = 2 net.ipv6.conf.default.use_tempaddr = 2
    – mcandril
    Aug 26, 2020 at 16:20

1 Answer 1

2

Network-Manager causes it. It manages its own configuration for every connection and configures your adapter to suit its needs. If you want it to use eui64 on your network, configure the connection accordingly. You may also make it the default by editing /etc/NetworkManager/NetworkManager.conf, adding this:

[connection]
ipv6.addr-gen-mode=eui64

From man 5 NetworkManager.conf:

   CONNECTION SECTION

   Specify default values for connections.

   Such default values are only consulted if the corresponding
   per-connection property explicitly allows for that. That means, all
   these properties correspond to a property of the connection profile
   (for example connection.mud-url). Only if the per-profile property is
   set to a special value that indicates to use the default, the default
   value from NetworkManager.conf is consulted. It depends on the
   property, which is the special value that indicates fallback to the
   default, but it usually is something like empty, unset values or
   special numeric values like 0 or -1. That means the effectively used
   value can first always be configured for each profile, and these
   default values only matter if the per-profile values explicitly
   indicates to use the default from NetworkManager.conf.

   Example:

       [connection]
       ipv6.ip6-privacy=0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .