I have a number of bootable USB drives with Ubuntu 18.04 which had been upgraded from past versions of Ubuntu. Now I am looking for the most proper and concise config for netplan to express a rule like : for the first onboard/pci wired Ethernet on the booted host (regardless of its interface name), configure it through DHCP or through Avahi autoipd as a fallback.
I have already replaced cron with systemd-cron, and removed rsyslog in favor of systemd-journald; now it's turn to remove ifupdown+resolvconf+isc-dhcp-client in favor of netplan+systemd-networkd
Thanks in advance for your responses.
(update from 2020-12-25)
I learned it could be done even without netplan.
Create networkd configs /etc/systemd/network/en.network
with content like
[Match]
Name=en*
[Network]
DHCP=ipv4
and /etc/systemd/network/wl.network
with content like
[Match]
Name=wl*
[Network]
DHCP=ipv4
then do systemctl enable systemd-networkd
, and after next reboot you will have any your en* interface configurable by networkd built-in dhcp client.
What is left to be found out, is how to use the same config of wpa_supplicant
when you have different wl* interface names when booting on different hardware.