NetworkConfiguration / dhcpcd

DHCP / IPv4LL / IPv6RA / DHCPv6 client.
https://roy.marples.name/projects/dhcpcd
BSD 2-Clause "Simplified" License
337 stars 108 forks source link

odd superflus IPv6 locallink #251

Open perkelix opened 11 months ago

perkelix commented 11 months ago

On 10.0.2, since a few days, whenever delegating a prefix, dhcpcd creates a fresh fe80:: address on the bridge, in addition to the existing one:

$ LC_ALL=C journalctl -b -u ifup@enp4s0.service | grep "p8h61 dhcpcd" | grep br0
Oct 04 05:58:21 p8h61 dhcpcd[950]: br0: activating for delegation
Oct 04 05:58:21 p8h61 dhcpcd[950]: br0: waiting for carrier
Oct 04 05:58:43 p8h61 dhcpcd[950]: br0: carrier acquired
Oct 04 05:58:43 p8h61 dhcpcd[950]: br0: IAID cd:8a:cb:71
Oct 04 05:58:43 p8h61 dhcpcd[950]: br0: adding address fe80::6e09:892:dc15:733b
Oct 04 05:58:45 p8h61 dhcpcd[950]: br0: adding delegated prefixes
Oct 04 05:58:45 p8h61 dhcpcd[950]: br0: adding address 2001:14ba:a0ee:1b05::1/64
Oct 04 05:58:45 p8h61 dhcpcd[950]: br0: adding route to 2001:14ba:a0ee:1b05::/64

As seen below, ::a887 is the address created when ifupdown creates the bridge. It has stable-privacy enabled via sysctl on bootup. Meanwhile, ::733b is created as above by dhcpcd.

5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether <redacted> brd ff:ff:ff:ff:ff:ff
    inet 172.16.1.1/16 brd 172.16.255.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 2001:14ba:a0ee:1b05::1/64 scope global dynamic noprefixroute 
       valid_lft 1988sec preferred_lft 1988sec
    inet6 fe80::6e09:892:dc15:733b/64 scope link 
       valid_lft forever preferred_lft forever
    inet6 fe80::b075:485:5641:a887/64 scope link stable-privacy 
       valid_lft forever preferred_lft forever

Am I missing anything? Why wouldn't dhcpcd keep on using the existing IPv6 locallink?

rsmarples commented 11 months ago

It's basically a race between the kernel adding the address and dhcpcd adding it. If a lladdr already exists then dhcpcd will use it.

By default dhcpcd will turn the sysctl off for the kernel adding lladdrs for the interface when it gets activated. This is because dhcpcd has supported stable private addresses for many years before any kernel did.

So don't turn the sysctls on and you should be fine.