Gentoo: Disable Predictable/Consistent Network Adapter Naming

You have probably noticed that network adapters in Linux now follow a naming convention of “enpXsY” or “wlpXsY” instead of “ethX” and “wlanX”. This is generally fine and doesn’t cause much issue. The one downside to the change is that Gentoo and Linux From Scratch VMs running on VMware will have ridiculous names like “eno16777728”. I haven’t noticed that on any other flavors, which is why I specified Gentoo in the title, but this fix should work for any distro as long as it boots from GRUB.

Simply run the following two commands and reboot and your network adapter should be named ‘eth0’.

echo 'GRUB_CMDLINE_LINUX="net.ifnames=0"' >> /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg

We could achieve the same result by adding ‘net.ifnames=0’ to /etc/grub.d/10_linux, on the line where the actual boot command is set. It’s around line 136ish and looks somewhat like the following:

linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} rw ${args}

If you insert the text between rw (sometimes ro) and ${args}, the result should be the same. But doing it that way sketches me out and could potentially lead to problems later on.

About: Bailey Kasin

I build virtual environments and challenges for Cybersecurity students to complete as a way to gain experience before graduating and entering the workforce.

Leave a Reply

Your email address will not be published. Required fields are marked *