Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting DuplicateAddressDetection=none doesn't disable DAD for link-local IPs #22763

Closed
slyon opened this issue Mar 16, 2022 · 5 comments · Fixed by #22824
Closed

Setting DuplicateAddressDetection=none doesn't disable DAD for link-local IPs #22763

slyon opened this issue Mar 16, 2022 · 5 comments · Fixed by #22824
Labels
network regression ⚠️ A bug in something that used to work correctly and broke through some recent commit
Milestone

Comments

@slyon
Copy link
Contributor

slyon commented Mar 16, 2022

systemd version the issue has been seen with

249.5

Used distribution

Ubuntu Jammy 22.04

Linux kernel version used (uname -a)

5.15

CPU architecture issue was seen on

x86

Expected behaviour you didn't see

Setting DuplicateAddressDetection=none in a .network file does not disable DAD for link-local IPs. I think this commit 1cf4ed1 may be related (landed in systemd v249). I've also tested the out-of-the-box systemd versions for Focal and Impish but there I can effectively disable DAD. If the IPs are set to non-link local addresses then the problem is not observed anymore.

I think at least this new behavior should be documented in https://systemd.network/systemd.network.html#DuplicateAddressDetection=

Unexpected behaviour you saw

I've noticed that setting DuplicateAddressDetection=none for an interface with a link-local address (e.g., 169.254.*) via a .network file added to /etc/systemd/network/ doesn't really disable Duplicate Address Detection.

Steps to reproduce the problem

1- Set up Ubuntu 22.04 VM
2- Increase systemlog level:

mkdir -p /etc/systemd/system/systemd-networkd.service.d/
cat > /etc/systemd/system/systemd-networkd.service.d/10-debug.conf <<EOF
[Service]
Environment=SYSTEMD_LOG_LEVEL=debug
EOF
systemctl daemon-reload && systemctl restart systemd-networkd

3- Configure a link-local address to a network interface on the VM:
vi /etc/systemd/network/10-netplan-enp7s0.network

[Match]
Name=enp7s0

[Address]
Address=169.254.240.10/24
DuplicateAddressDetection=ipv4

4- Restart services and apply

systemctl daemon-reload && systemctl restart systemd-networkd && systemctl restart networkd-dispatcher.service
netplan apply

5- Check if DAD is running (it should):

journalctl -b -u systemd-networkd --no-pager -o short-precise | grep -i ACD

6- Set DuplicateAddressDetection=none in
/etc/systemd/network/10-netplan-enp7s0.network

7- Restart services and apply as in step 4
8- Check if DAD is running as in step 5 (it shouldn't, but
it's there)

After step 7 DAD should be disabled as expected and it
shouldn't be executed when running 'netplan apply' but
it is actually executed.

Additional program output to the terminal or log subsystem illustrating the issue

---------------
Tests on Focal:
---------------

root@focal-1:~# cat /etc/systemd/network/10-netplan-enp7s0.network
[Match]
Name=enp7s0

[Address]
Address=169.254.240.10/24
DuplicateAddressDetection=ipv4
root@focal-1:~# netplan apply
root@focal-1:~# journalctl -b -u systemd-networkd --no-pager -o short-precise | grep -i ACD
Mar 10 14:24:37.915226 focal-1 systemd-networkd[1863]: enp7s0: Starting IPv4ACD client. Probing address 169.254.240.10
Mar 10 14:24:38.454594 focal-1 systemd-networkd[1863]: IPV4ACD: Probing 169.254.240.10
Mar 10 14:24:38.455467 focal-1 systemd-networkd[1863]: IPV4ACD: Conflict on 169.254.240.10 (1)
Mar 10 14:24:38.458219 focal-1 systemd-networkd[1863]: IPV4ACD: STOPPED
Mar 10 14:24:38.458267 focal-1 systemd-networkd[1863]: enp7s0: Stopping ACD client...
Mar 10 14:24:50.941389 focal-1 systemd-networkd[1863]: IPV4ACD: STOPPED
Mar 10 14:24:50.941398 focal-1 systemd-networkd[1863]: enp7s0: Stopping ACD client...
Mar 10 14:24:51.140643 focal-1 systemd-networkd[1925]: enp7s0: Starting IPv4ACD client. Probing address 169.254.240.10
Mar 10 14:24:51.454399 focal-1 systemd-networkd[1925]: IPV4ACD: Probing 169.254.240.10
Mar 10 14:24:51.455156 focal-1 systemd-networkd[1925]: IPV4ACD: Conflict on 169.254.240.10 (1)
Mar 10 14:24:51.455491 focal-1 systemd-networkd[1925]: IPV4ACD: STOPPED
Mar 10 14:24:51.455510 focal-1 systemd-networkd[1925]: enp7s0: Stopping ACD client...
root@focal-1:~# vi /etc/systemd/network/10-netplan-enp7s0.network
root@focal-1:~# cat /etc/systemd/network/10-netplan-enp7s0.network
[Match]
Name=enp7s0

[Address]
Address=169.254.240.10/24
DuplicateAddressDetection=none
root@focal-1:~# netplan apply
root@focal-1:~# journalctl -b -u systemd-networkd --no-pager -o short-precise | grep -i ACD
Mar 10 14:24:37.915226 focal-1 systemd-networkd[1863]: enp7s0: Starting IPv4ACD client. Probing address 169.254.240.10
Mar 10 14:24:38.454594 focal-1 systemd-networkd[1863]: IPV4ACD: Probing 169.254.240.10
Mar 10 14:24:38.455467 focal-1 systemd-networkd[1863]: IPV4ACD: Conflict on 169.254.240.10 (1)
Mar 10 14:24:38.458219 focal-1 systemd-networkd[1863]: IPV4ACD: STOPPED
Mar 10 14:24:38.458267 focal-1 systemd-networkd[1863]: enp7s0: Stopping ACD client...
Mar 10 14:24:50.941389 focal-1 systemd-networkd[1863]: IPV4ACD: STOPPED
Mar 10 14:24:50.941398 focal-1 systemd-networkd[1863]: enp7s0: Stopping ACD client...
Mar 10 14:24:51.140643 focal-1 systemd-networkd[1925]: enp7s0: Starting IPv4ACD client. Probing address 169.254.240.10
Mar 10 14:24:51.454399 focal-1 systemd-networkd[1925]: IPV4ACD: Probing 169.254.240.10
Mar 10 14:24:51.455156 focal-1 systemd-networkd[1925]: IPV4ACD: Conflict on 169.254.240.10 (1)
Mar 10 14:24:51.455491 focal-1 systemd-networkd[1925]: IPV4ACD: STOPPED
Mar 10 14:24:51.455510 focal-1 systemd-networkd[1925]: enp7s0: Stopping ACD client...
Mar 10 14:25:14.611042 focal-1 systemd-networkd[1925]: IPV4ACD: STOPPED
Mar 10 14:25:14.611048 focal-1 systemd-networkd[1925]: enp7s0: Stopping ACD client...
root@focal-1:~#

---------------
Tests on Jammy:
---------------

ubuntu@jammy-2:~$ cat /etc/systemd/network/10-netplan-ens8.network
[Match]
Name=ens8

[Address]
Address=169.254.241.10/24
DuplicateAddressDetection=none
ubuntu@jammy-2:~$ networkctl status ens8 --no-pager
â—� 3: ens8                                                                      
                     Link File: /usr/lib/systemd/network/99-default.link
                  Network File: /etc/systemd/network/10-netplan-ens8.network
                          Type: ether
                         State: routable (configured)
                  Online state: online                                         
             Alternative Names: enp0s8
                          Path: pci-0000:00:08.0
                        Driver: virtio_net
                        Vendor: Red Hat, Inc.
                         Model: Virtio network device
                    HW Address: 52:54:00:ee:01:d1
                           MTU: 1500 (min: 68, max: 65535)
                         QDisc: fq_codel
  IPv6 Address Generation Mode: eui64
          Queue Length (Tx/Rx): 1/1
              Auto negotiation: no
                         Speed: n/a
                       Address: 169.254.241.10
                                fe80::5054:ff:feee:1d1
             Activation Policy: up
           Required For Online: yes
             DHCP6 Client DUID: DUID-EN/Vendor:0000ab117b40e8a688053bff0000
ubuntu@jammy-2:~$ sudo netplan apply
ubuntu@jammy-2:~$ journalctl -b -u systemd-networkd --no-pager -o short-precise | grep -i ACD
Mar 10 14:55:44.903842 jammy-2 systemd-networkd[3102]: /etc/systemd/network/10-netplan-ens8.network: An IPv4 link-local address is specified, enabling IPv4 Address Conflict Detection (ACD).
Mar 10 14:55:44.948006 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: running -> init
Mar 10 14:55:44.948009 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: STOPPED
Mar 10 14:55:44.948014 jammy-2 systemd-networkd[3102]: ens8: Removing address 169.254.241.10, as the ACD client is stopped.
Mar 10 14:55:44.952076 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: init -> started
Mar 10 14:55:44.956764 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: started -> waiting-probe
Mar 10 14:55:44.956905 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: waiting-probe -> init
Mar 10 14:55:44.987725 jammy-2 systemd-networkd[3102]: ens8: Configuring IPv4ACD for address 169.254.241.10
Mar 10 14:55:44.990847 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: init -> started
Mar 10 14:55:44.990867 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: started -> waiting-probe
Mar 10 14:55:45.359288 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Probing 169.254.241.10
Mar 10 14:55:45.359461 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: waiting-probe -> probing
Mar 10 14:55:46.859095 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Probing 169.254.241.10
Mar 10 14:55:48.359157 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Probing 169.254.241.10
Mar 10 14:55:48.359486 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: probing -> waiting-announce
ubuntu@jammy-2:~$ sudo vi /etc/systemd/network/10-netplan-ens8.network
ubuntu@jammy-2:~$ cat /etc/systemd/network/10-netplan-ens8.network
[Match]
Name=ens8

[Address]
Address=169.254.241.10/24
DuplicateAddressDetection=ipv4
ubuntu@jammy-2:~$ sudo netplan apply
ubuntu@jammy-2:~$ journalctl -b -u systemd-networkd --no-pager -o short-precise | grep -i ACD
Mar 10 14:55:44.903842 jammy-2 systemd-networkd[3102]: /etc/systemd/network/10-netplan-ens8.network: An IPv4 link-local address is specified, enabling IPv4 Address Conflict Detection (ACD).
Mar 10 14:55:44.948006 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: running -> init
Mar 10 14:55:44.948009 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: STOPPED
Mar 10 14:55:44.948014 jammy-2 systemd-networkd[3102]: ens8: Removing address 169.254.241.10, as the ACD client is stopped.
Mar 10 14:55:44.952076 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: init -> started
Mar 10 14:55:44.956764 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: started -> waiting-probe
Mar 10 14:55:44.956905 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: waiting-probe -> init
Mar 10 14:55:44.987725 jammy-2 systemd-networkd[3102]: ens8: Configuring IPv4ACD for address 169.254.241.10
Mar 10 14:55:44.990847 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: init -> started
Mar 10 14:55:44.990867 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: started -> waiting-probe
Mar 10 14:55:45.359288 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Probing 169.254.241.10
Mar 10 14:55:45.359461 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: waiting-probe -> probing
Mar 10 14:55:46.859095 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Probing 169.254.241.10
Mar 10 14:55:48.359157 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Probing 169.254.241.10
Mar 10 14:55:48.359486 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: probing -> waiting-announce
Mar 10 14:55:50.608901 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Announcing 169.254.241.10
Mar 10 14:55:50.608921 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: waiting-announce -> announcing
Mar 10 14:55:52.859143 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Announcing 169.254.241.10
Mar 10 14:55:55.109042 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: announcing -> running
Mar 10 14:56:18.263014 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: running -> init
Mar 10 14:56:18.263017 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: STOPPED
Mar 10 14:56:18.263021 jammy-2 systemd-networkd[3102]: ens8: Removing address 169.254.241.10, as the ACD client is stopped.
Mar 10 14:56:18.264252 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: init -> started
Mar 10 14:56:18.266537 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: started -> waiting-probe
Mar 10 14:56:18.281802 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: waiting-probe -> init
Mar 10 14:56:18.286309 jammy-2 systemd-networkd[3102]: ens8: Configuring IPv4ACD for address 169.254.241.10
Mar 10 14:56:18.286387 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: init -> started
Mar 10 14:56:18.286404 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: started -> waiting-probe
Mar 10 14:56:18.289880 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: waiting-probe -> init
Mar 10 14:56:18.289883 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: STOPPED
Mar 10 14:56:18.290180 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: init -> started
Mar 10 14:56:18.292430 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: started -> waiting-probe
Mar 10 14:56:19.360435 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Probing 169.254.241.10
Mar 10 14:56:19.360464 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: waiting-probe -> probing
Mar 10 14:56:20.859302 jammy-2 systemd-networkd[3102]: ens8: IPv4ACD: Probing 169.254.241.10

Forwarded from: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1964494

@yuwata yuwata added the network label Mar 16, 2022
@yuwata
Copy link
Member

yuwata commented Mar 22, 2022

This is intended change by 1cf4ed1.
Do you have any issues with the change, except for the above test failure?

@yuwata yuwata added the needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer label Mar 22, 2022
@yuwata
Copy link
Member

yuwata commented Mar 22, 2022

Maybe, if DuplicateAddressDetection= is explicitly disabled, then we should honor it.
But, still I'd like to know what kind of issues are triggered by 1cf4ed1.

@slyon
Copy link
Contributor Author

slyon commented Mar 22, 2022

No issue except for the failure described above.

I understand that this change was intended by 1cf4ed1 but I think the behavior is confusing, as it ignores/overrides explicit user configuration.

Maybe, if DuplicateAddressDetection= is explicitly disabled, then we should honor it.

ACK.
Or if not, at least the overriding behavior should be documented and a warning should be logged about overriding explicit user configuration.

yuwata added a commit to yuwata/systemd that referenced this issue Mar 22, 2022
…etection=

Background:
Setting `DuplicateAddressDetection=ipv4` is meaningless for IPv6
addresses. Similary, `DuplicateAddressDetection=ipv6` is meaningless for
IPv4 addresses. Hence, setting boolean value is enough. However, very
unfortunately, the setting was implemented so badly, and we cannot use
boolean string for the setting without breaking backward compatibility.
See config_parse_duplicate_address_detection().

Solution:
Hence, this deprecates DuplicateAddressDetection= and re-implement
similar setting EnableDuplicateAddressDetection=, which only takes
boolean string.

Justification:
The naming is slightly redundant, but should not introduce any
confusions. Also, we did similar change for another unfortunate situation
in PrefixRoute=, and the setting was renamed PrefixRoute= -> AddPrefixRoute=.

This also changes that the IPv4 ACD is enabled for IPv4 link-local
addresses only when it is not explicitly disabled.

Fixes systemd#22763.
@yuwata
Copy link
Member

yuwata commented Mar 22, 2022

@slyon Thanks. Fix is waiting in #22824.

yuwata added a commit to yuwata/systemd that referenced this issue Mar 22, 2022
yuwata added a commit to yuwata/systemd that referenced this issue Mar 22, 2022
… disabled explicitly

The commit 1cf4ed1 makes the IPv4 ACD
enabled unconditionally for IPv4 link-local addresses even if users
explicitly disable ACD.

This makes the IPv4 ACD is enabled by default, but honor user setting.

Fixes systemd#22763.
@slyon
Copy link
Contributor Author

slyon commented Mar 22, 2022

Thank you very much! 👏

@yuwata yuwata added regression ⚠️ A bug in something that used to work correctly and broke through some recent commit and removed needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer labels Mar 23, 2022
@yuwata yuwata added this to the v251 milestone Mar 23, 2022
keszybz pushed a commit to yuwata/systemd that referenced this issue Mar 23, 2022
… disabled explicitly

The commit 1cf4ed1 makes the IPv4 ACD
enabled unconditionally for IPv4 link-local addresses even if users
explicitly disable ACD.

This makes the IPv4 ACD is enabled by default, but honor user setting.

Fixes systemd#22763.
keszybz pushed a commit that referenced this issue Mar 23, 2022
… disabled explicitly

The commit 1cf4ed1 makes the IPv4 ACD
enabled unconditionally for IPv4 link-local addresses even if users
explicitly disable ACD.

This makes the IPv4 ACD is enabled by default, but honor user setting.

Fixes #22763.
mhei added a commit to chargebyte/meta-chargebyte-distro that referenced this issue Jun 29, 2022
Our configuration with the static IPv4 fallback address suffers from
the following upstream regression in systemd v250:

systemd/systemd#22763

This is a backport of the corresponding fix.

It also disables DAD for the fallback IP address,
otherwise it might be removed when a second device
is detected. While this should be re-considered later,
this restores the current/older behavior for now.

Signed-off-by: Michael Heimpold <michael.heimpold@in-tech.com>
mhei added a commit to chargebyte/meta-chargebyte-distro that referenced this issue Jul 11, 2022
Our configuration with the static IPv4 fallback address suffers from
the following upstream regression in systemd v250:

systemd/systemd#22763

This is a backport of the corresponding fix.

It also disables DAD for the fallback IP address,
otherwise it might be removed when a second device
is detected. While this should be re-considered later,
this restores the current/older behavior for now.

Signed-off-by: Michael Heimpold <michael.heimpold@in-tech.com>
bluca pushed a commit to bluca/systemd that referenced this issue Jan 27, 2023
… disabled explicitly

The commit 1cf4ed1 makes the IPv4 ACD
enabled unconditionally for IPv4 link-local addresses even if users
explicitly disable ACD.

This makes the IPv4 ACD is enabled by default, but honor user setting.

Fixes systemd#22763.

(cherry picked from commit 2859932)
Werkov pushed a commit to Werkov/systemd that referenced this issue Nov 1, 2023
… disabled explicitly

The commit 1cf4ed1 makes the IPv4 ACD
enabled unconditionally for IPv4 link-local addresses even if users
explicitly disable ACD.

This makes the IPv4 ACD is enabled by default, but honor user setting.

Fixes systemd#22763.

(cherry picked from commit 2859932)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network regression ⚠️ A bug in something that used to work correctly and broke through some recent commit
2 participants