Rename Ethernet interfaces to eth0

less than 1 minute read

systemd in Debian & Ubuntu generates robust Ethernet interface names like p1p1 or enp48a instead of the traditional eth0 to avoid race conditions.

Robust systemd eth0 | wlan0

  1. create a file /etc/systemd/network/ with the content, using your Raspberry Pi MAC address obtained from ip a:
  2. ensure the file /etc/systemd/network/ exists with the content
    NamePolicy=kernel database onboard slot path

I find this method more intuitive than using udev rules, which is another alternative method.

Alternative GRUB

This method is simpler, but does not work on non-GRUB hardware (e.g. ARM systems like Raspberry Pi).

  1. edit /etc/default/grub:
    GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
  2. in Terminal,
  3. reboot
  4. type
    ip a

    to confirm your network adapter is at eth0


When is eth0 name needed? Some old software (e.g. old Matlab versions) will only accept eth0 for licensing using the MAC address (low security!) Also sometimes for convenience in embedded/IoT systems where you know you’ll only have one Ethernet interface, you’d like to simply use eth0.


Which software have you found it necessary to use this procedure for? Let us know in the comments below.




Leave a Comment