Last commits about hotplug detection are around 2005, which is a very
long time ago kernel-wise and udev-wise. A wireless USB dongle shared
from the host via libvirt appears as hotpluggable, but both lo and
ens3 appear several times in /etc/network/devhotplug, which seems to
hint that what worked 15+ years ago no longer does.
Writing allow-hotplug entries becomes very problematic when network
interfaces need some time to show up (e.g. the aforementioned dongle,
rtl8192cu-based), and networking.service returns before they have a
chance to appear: this means no configuration at all.
Switching to auto all the time avoids this issue. And if some device
is unplugged, the only downside is a slightly longer delay at bootup,
and a failed networking.service unit.
At least in the WPA case, wpa-* options cannot be set in both the “inet
dhcp” and the “inet6 auto” stanzas: testing shows that wpa_supplicant
would trigger association, possibly get an address via DHCP, before
moving on to the SLAAC stanza, and deauthenticate, leaving the network
interface DOWN.
If both DHCP and SLAAC are enabled, IPv6 settings should be received
via RAs anyway, so writing a SLAAC entry seems superfluous.
Fix ifupdown configuration for wireless connections.
Otherwise we would only leave the loopback interface… When dealing with
a wireless interface that's considered secured (WPA or non-empty WEP
passphrase), protect /etc/network/interfaces by setting its mode to 600.