Modern Linux distributions such as Debian 13/12 and Ubuntu 24.04/22.04 use predictable network interface names like ens18, enp0s3, or eno1 instead of the classic eth0, eth1 convention. This naming scheme was introduced by systemd and udev to solve a real problem – interface names could shift between reboots on systems with multiple NICs, causing services to bind to the wrong interface.

The predictable naming scheme bases names on firmware data, PCI slot topology, or MAC address. While this works well for most production servers, there are legitimate reasons to revert to the old eth0 style naming.

Why You Might Want eth0 Names Back

After managing Linux servers for over a decade, I have run into several situations where reverting to classic interface names makes sense:

  • Container and VM templates – When building golden images for LXC, Docker host networks, or VM templates, hardcoded interface names like enp0s3 will not match the target hypervisor or hardware. Using eth0 keeps templates portable.
  • Legacy scripts and applications – Older monitoring tools, firewall scripts, and network automation that reference eth0 directly will break with predictable names unless you rewrite every script.
  • Single-NIC servers – On servers with one network interface, the predictable naming adds no real value. The classic eth0 is shorter and easier to type.
  • Consistency across mixed environments – If you manage a mix of older and newer distributions, standardizing on eth0 reduces confusion.

Prerequisites

  • A Debian 13 (Trixie), Debian 12 (Bookworm), Ubuntu 24.04 (Noble Numbat), or Ubuntu 22.04 (Jammy Jellyfish) system
  • Root or sudo access
  • Console access (IPMI, KVM, or physical) as a fallback in case network breaks during the change

Before making any changes, note your current interface name and IP configuration:

ip addr show
ip route show

Save the output somewhere safe. You will need it if something goes wrong.

Check your current interface name

$ ip -br link show
lo               UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
ens18            UP             bc:24:11:a6:42:e1 <BROADCAST,MULTICAST,UP,LOWER_UP>

In this example, the interface is named ens18. After applying any of the methods below, it will become eth0.

Method 1 – GRUB Kernel Parameters (Recommended)

This is the cleanest and most widely used approach. It works by passing kernel boot parameters that disable both systemd predictable naming and the biosdevname plugin.

Step 1 – Edit the GRUB configuration

Open the GRUB defaults file:

sudo nano /etc/default/grub

Find the line that starts with GRUB_CMDLINE_LINUX and add net.ifnames=0 biosdevname=0 inside the quotes. For example, if your line currently looks like:

GRUB_CMDLINE_LINUX=""

Change it to:

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

If there are already other parameters inside the quotes, just append net.ifnames=0 biosdevname=0 separated by a space.

Step 2 – Verify the GRUB configuration

Before applying, confirm the edit looks correct:

grep GRUB_CMDLINE_LINUX /etc/default/grub

Expected output:

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

Step 3 – Update GRUB

On Debian 13/12:

sudo update-grub

On Ubuntu 24.04/22.04:

sudo update-grub

Both distributions support the update-grub command. Verify the generated config includes your parameters:

grep -i "net.ifnames" /boot/grub/grub.cfg

You should see net.ifnames=0 biosdevname=0 appearing in the boot entries.

Step 4 – Update network configuration before rebooting

This step is critical. If you reboot without updating your network configuration to reference eth0, you will lose network connectivity.

On Debian 13/12 using /etc/network/interfaces:

sudo sed -i 's/ens18/eth0/g' /etc/network/interfaces

Replace ens18 with whatever your current interface name is. Verify the change:

cat /etc/network/interfaces

On Ubuntu 24.04/22.04 using Netplan, edit your Netplan config file (typically /etc/netplan/01-netcfg.yaml or /etc/netplan/50-cloud-init.yaml):

ls /etc/netplan/

Then edit the file and replace the old interface name with eth0:

sudo nano /etc/netplan/01-netcfg.yaml

Change the interface name from the predictable name to eth0. For example:

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true

Or if using a static IP:

network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 192.168.1.100/24
      routes:
        - to: default
          via: 192.168.1.1
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4

Validate the Netplan configuration before rebooting:

sudo netplan generate

If the command produces no output, the config is valid.

Step 5 – Reboot and verify

sudo reboot

After the system comes back up, verify the interface name:

ip addr show

You should now see eth0 instead of the old predictable name. Confirm you have network connectivity:

ping -c 3 8.8.8.8

Method 2 – Custom udev Rules

If you need more control over which interface gets which name – for example, mapping a specific NIC by MAC address to eth0 – udev rules give you that precision.

Step 1 – Find the MAC address of your interface

ip link show

Note the MAC address (the link/ether value) for each interface you want to rename.

Step 2 – Create a udev rules file

sudo nano /etc/udev/rules.d/70-persistent-net.rules

Add a rule for each interface. Replace the MAC address with your own:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="bc:24:11:a6:42:e1", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="bc:24:11:a6:42:e2", NAME="eth1"

Step 3 – Verify the rules file

cat /etc/udev/rules.d/70-persistent-net.rules

Make sure the MAC addresses are correct and the syntax has no typos.

Step 4 – Disable predictable naming via GRUB

For udev rules to take effect, you still need to disable the predictable naming scheme. Follow the same GRUB steps from Method 1 – add net.ifnames=0 biosdevname=0 to GRUB_CMDLINE_LINUX and run sudo update-grub.

Step 5 – Update network config and reboot

Update your network configuration as described in Method 1, Step 4 – then reboot and verify:

sudo reboot
ip addr show
ip link show

Method 3 – systemd .link File

systemd-networkd uses .link files to configure network device properties including the name. This method works without modifying GRUB parameters and is the most “systemd-native” approach.

Step 1 – Find the MAC address

ip link show

Step 2 – Create a .link file

sudo nano /etc/systemd/network/10-eth0.link

Add the following content, replacing the MAC address with your own:

[Match]
MACAddress=bc:24:11:a6:42:e1

[Link]
Name=eth0

For a second interface:

sudo nano /etc/systemd/network/10-eth1.link
[Match]
MACAddress=bc:24:11:a6:42:e2

[Link]
Name=eth1

Step 3 – Verify the .link file

cat /etc/systemd/network/10-eth0.link

Step 4 – Update initramfs

The .link files need to be included in the initramfs to take effect early in boot:

On Debian 13/12:

sudo update-initramfs -u

On Ubuntu 24.04/22.04:

sudo update-initramfs -u

Step 5 – Update network config and reboot

Update your network configuration files to use eth0 as described in Method 1, Step 4. Then reboot:

sudo reboot

After reboot, verify:

ip addr show

Verification Steps

After rebooting with any method, run through these checks to confirm everything is working:

# Check interface names
ip -br link show

# Check IP addresses
ip -br addr show

# Check routing table
ip route show

# Test connectivity
ping -c 3 8.8.8.8

# Test DNS resolution
ping -c 3 google.com

# Check which boot parameters are active
cat /proc/cmdline

Expected output for the interface check should look similar to:

$ ip -br link show
lo               UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
eth0             UP             bc:24:11:a6:42:e1 <BROADCAST,MULTICAST,UP,LOWER_UP>

Warning – What Can Go Wrong

Renaming network interfaces incorrectly will leave your server without network access after reboot. Keep these points in mind:

  • Always have console access ready – Before rebooting, make sure you can reach the server via IPMI, iDRAC, iLO, KVM, or physical console. If the network does not come up, this is your only way in.
  • Update network config before rebooting – The most common mistake is changing the interface name scheme without updating /etc/network/interfaces or Netplan configs to match. Your system will boot with eth0 but the network config will still reference ens18 – and nothing will work.
  • Firewall rules referencing old names – If you have iptables or nftables rules that reference the old interface name, those rules will silently stop matching traffic. Check your firewall configuration.
  • Services bound to specific interfaces – Applications configured to listen on a specific interface name (like bind-address directives in some daemons) will need updating.
  • Do not combine Method 1 and Method 3 – Using both GRUB parameters and systemd .link files can cause conflicts. Pick one method and stick with it.

Troubleshooting

Interface still has predictable name after reboot

Check that the kernel parameters were applied:

cat /proc/cmdline

If you do not see net.ifnames=0 biosdevname=0 in the output, GRUB did not pick up your changes. Verify /etc/default/grub and run sudo update-grub again.

No network after reboot

Connect via console and check what interfaces exist:

ip link show

If you see eth0 but it has no IP, your network configuration file still references the old name. Fix it:

On Debian:

sudo nano /etc/network/interfaces
# Change old name to eth0
sudo systemctl restart networking

On Ubuntu:

sudo nano /etc/netplan/01-netcfg.yaml
# Change old name to eth0
sudo netplan apply

systemd .link file not working

The .link file must be in the initramfs. If you forgot to run update-initramfs -u, the file will not be read early enough during boot. Run the update and reboot again:

sudo update-initramfs -u
sudo reboot

Also verify the .link file has correct permissions:

ls -la /etc/systemd/network/10-eth0.link

It should be readable (644 permissions).

Multiple interfaces getting the same name

If you have multiple NICs and they are all getting named eth0, you need to use udev rules (Method 2) or .link files (Method 3) to explicitly map each MAC address to a specific name like eth0, eth1, and so on.

Reverting the changes

To go back to predictable names, reverse the steps:

# Remove kernel parameters from GRUB
sudo nano /etc/default/grub
# Remove net.ifnames=0 biosdevname=0 from GRUB_CMDLINE_LINUX
sudo update-grub

# Remove udev rules if created
sudo rm -f /etc/udev/rules.d/70-persistent-net.rules

# Remove .link files if created
sudo rm -f /etc/systemd/network/10-eth0.link
sudo update-initramfs -u

# Update network config back to predictable name
# Then reboot
sudo reboot

Summary

Changing network interface names back to the classic eth0 scheme on Debian 13/12 and Ubuntu 24.04/22.04 is straightforward once you understand the three available methods. The GRUB kernel parameter approach (Method 1) is the simplest and works for most use cases. Use udev rules (Method 2) when you need MAC-based mapping for multi-NIC servers. The systemd .link file approach (Method 3) is the most native to modern systemd-based distributions.

Whichever method you choose, the critical step is updating your network configuration files to reference the new interface names before rebooting. Always have console access ready as a fallback, and test connectivity immediately after the reboot.

LEAVE A REPLY

Please enter your comment!
Please enter your name here