1

I've got a network with both an radvd and a kea-dhcp6 server running. Clients are running systemd-networkd (currently debian stable) and:

[Network]
IPv6AcceptRA=true
DHCP=yes

The desired behaviour is to get the client configured with an address from DHCPv6, and also a route from RA. Currently, with this configuration, the client gets the correct IP address from DHCP, an auto-generated / auto-assigned global dynamic mngtmpaddr noprefixroute address, and the correct route

default proto static metric 1024
        nexthop via fe80::20d:b9ff:fe54:2d18 dev eno1 weight 1 pref medium

For boring reasons, I'd like the system to prefer the DHCPv6-assigned address as a source address. From what I can tell, it's possible to do this either by setting this address as the "home" address, or by making it the only address available. I gather that systemd-networkd can't set the home flag currently on a DHCP-obtained address, so I was trying to work out how to do the latter.

The problem is that by setting IPv6AcceptRA=false, this does indeed remove the address, but it also removes the default LL-address route, which breaks a bunch of other things.

Is there a way I can have the RA-assigned LL route, but not have the auto-configured address that comes with it?

1 Answer 1

3

The best solution depends on whether you want to disable address auto-configuration for the whole network, or just for one device.

For the whole network you can tell radvd to not set the "autonomous" flag in its announcements. That will prevent all systems on the network from autogenerating their own addresses. You can use the AdvAutonomous option for that.

If you want to set this on the client at the kernel level, you need to tell the kernel to not generate its own addresses. This is easiest done by creating /etc/sysctl.d/10-ipv6-autoconf.conf with these contents:

net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.default.autoconf = 0

This file is processed after each reboot. You can activate the new settings manually by runnint sudo sysctl --system.

When you want to use systemd-networkd the following should work, but I haven't tried it myself:

[Network]
IPv6AcceptRA=true
DHCP=yes

[IPv6AcceptRA]
UseAutonomousPrefix=false
2
  • Thanks! Unfortunately I have some Android devices on this network, so disabling AdvAutonomous is not an option. I will experiment with the systctl settings.
    – growse
    Commented Mar 14, 2021 at 21:23
  • Alas, despite setting net.ipv6.conf.[all|default|eth0].autoconf=0, I still get a dynamic mngtmpaddr noprefixroute address on startup, and when restarting networkd
    – growse
    Commented Mar 14, 2021 at 22:59

You must log in to answer this question.

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