It turns out that I'm trying to create a portable distro while getting prepared for any kind of hardware failure.
I'm creating (or restoring) a Debian distro by multistrap (or from my backups) and requiring the resulting disk to be bootable on a new (mostly compatible) hardware, including a VirtualBox machine.
As I asked before, one of the few required things for a "portable distro" is handling the network interfaces' names.
For example, on the real machine, first ethernet device is named as enp2s0 and in VirtualBox, it's named as enp0s3. How am I supposed to generate a /etc/network/interfaces file on boot?
Is there a more generic way to remap the network interface names (by symbolic links, maybe) and let every application use those names (the role names) without the necessity to know the real network interface names of the underlying hardware?
ifupdownis pretty inept at handling it nicely. – Dec 25 '19 at 10:29touch /etc/udev/rules.d/80-net-setup-link.rulestrick didn't work on Debian 10. – ceremcem Dec 25 '19 at 10:38ifconfigoutput after a reboot: https://gist.github.com/ceremcem/fe29b009ba02f283bf34abe55b9dee27 What is the black magic behindtouch .../80-net-setup-link.rules? – ceremcem Dec 25 '19 at 11:02/etc/udev/rules.dfiles override those from/lib/udev/rules.d. The interface renaming is called from/lib/udev/rules.d/80-net-setup-link.rules. – Dec 25 '19 at 11:04/etc/network/interfaceson boot time and use the old network interface names as "role names" in scripts via a converter program, likelan_eth=$(get-iface "eth0")in place oflan_eth="eth0"– ceremcem Dec 25 '19 at 11:15