#1041787 ifupdown: networking service won't restart because eth0 has been renamed

Package:
ifupdown
Source:
ifupdown
Description:
high level tools to configure network interfaces
Submitter:
Daniel Essin
Date:
2023-07-23 16:15:06 UTC
Severity:
normal
#1041787#5
Date:
2023-07-23 16:11:21 UTC
From:
To:
Dear Maintainer,


   * What led up to the situation?
When my system boots, eth0 gets renamed to enp5s0
When issuing systemctl restart networking, it fails and says can't find eth0

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
I made the following modification to /etc/default/grub

#GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

followed by:
grub-mkconfig -o /boot/grub/grub.cfg
reboot

   * What was the outcome of this action?
After preventing the renaming, systemctl restart networking succeeds

The renaming of  eth0 is apparently very common. After speding several hours
searching the web I finally hit upong the right serch terms and see that dozens
of people have questions relating the this renaming process.

Since it so common to have eth0 renamed, the networking service should be aware
of this and not fail because it can't find eth0. It should, instead, be able to
detect the presence of the alias name that has been assigned to eth0 and then
use that to start, stop or restart the service. It should not fail simply
because some other component of the system has decided (?) that renaming was
advisable.

Perhaps the default for Debian (linux?) should be to not rename but to provide
a command to rename or create an alias in those situations where it is
absolutely essential.
--- /etc/network/interfaces.d/setup:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
--- up and down scripts installed: /etc/network/if-down.d: total 8 -rwxr-xr-x 1 root root 1015 Aug 8 2022 avahi-autoipd lrwxrwxrwx 1 root root 29 Jan 25 13:11 bridge -> /lib/bridge-utils/ifupdown.sh -rwxr-xr-x 1 root root 759 Dec 9 2022 resolved lrwxrwxrwx 1 root root 32 Feb 24 05:01 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh /etc/network/if-post-down.d: total 4 lrwxrwxrwx 1 root root 29 Jan 25 13:11 bridge -> /lib/bridge-utils/ifupdown.sh -rwxr-xr-x 1 root root 1409 Mar 7 2020 wireless-tools lrwxrwxrwx 1 root root 32 Feb 24 05:01 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh /etc/network/if-pre-up.d: total 8 lrwxrwxrwx 1 root root 29 Jan 25 13:11 bridge -> /lib/bridge-utils/ifupdown.sh -rwxr-xr-x 1 root root 4191 Mar 7 2020 wireless-tools lrwxrwxrwx 1 root root 32 Feb 24 05:01 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh /etc/network/if-up.d: total 12 -rwxr-xr-x 1 root root 923 Aug 8 2022 avahi-autoipd -rwxr-xr-x 1 root root 4663 Dec 9 2022 resolved lrwxrwxrwx 1 root root 32 Feb 24 05:01 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh