Support DuplicateAddressDetection by default

Bug #1959190 reported by Lukas Märdian
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
Triaged
Wishlist
Unassigned

Bug Description

netplan & networkd only use systemd-networkd's default of DuplicateAddressDetection=ipv6, thus not checking for IPv4 conflicts.

From what I know RedHat based systems on the other hand use the arping tool during ifup in their ifcfg system (ARPCHECK=yes by default) to check for IP conflicts. In order to reach a similar result in Ubuntu, we would need to place an override configuration snippet in /etc/systemd/network/10-netplan-eth0.network.d/override.conf, specifying an [Address] section and corresponding DuplicateAddressDetection=both setting for each IP address [0].

This is probably even something that netplan should be doing by default, but it is not currently.

[0] https://www.freedesktop.org/software/systemd/man/systemd.network.html#DuplicateAddressDetection=

Lukas Märdian (slyon)
Changed in netplan:
importance: Undecided → Wishlist
Lukas Märdian (slyon)
Changed in netplan:
status: New → Triaged
no longer affects: netplan.io (Ubuntu)
Revision history for this message
Aleksandar Ivanisevic (aleksandar-e) wrote :

conf override still requires you to know the interface name, I'm using a solution where an interface is killed from the network dispatcher if a duplicate is detected. IP will be up for a short time so some packets might be lost, but it works universally, no metter how many interfaces are there or how they are called.

cat<<'EOF'>/etc/networkd-dispatcher/routable.d/dad.sh
#!/bin/bash
# check for duplicate IP and either kill the interface or proceed
if arping -0 -c 2 -w 2 $ADDR; then
   ip link set $IFACE down
   echo conflict detected on $IFACE for $ADDR, it has been shut down
else
   echo no duplicate IPs detected on $IFACE addr $ADDR
fi
EOF
chmod +x /etc/networkd-dispatcher/routable.d/dad.sh

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.