Props to Alpine and Kali for disabling this bullshit out of the box
Context for newbies: Linux refers to network adapters (wifi cards, ethernet cards, etc.) by so called "interfaces". For the longest time, the interface names were assigned based on the type of device and the order in which the system discovered it. So, eth0, eth1, wlan0, and wwan0 are all possible interface names. This, however, can be an issue: "the order in which the system discovered it" is not deterministic, which means hardware can switch interface names across reboots. This can be a real issue for things like servers that rely on interface names staying the same.
The solution to this issue is to assign custom names based on MAC address. The MAC address is hardcoded into the network adaptor, and will not change. (There are other ways to do this as well, such as setting udev rules).
Redhat, however, found this solution too simple and instead devised their own scheme for assigning network interface names. It fails at solving the problem it was created to solve while making it much harder to type and remember interface names.
To disable predictable interface naming and switch back to the old scheme, add net.ifnames=0 and biosdevname=0 to your boot paramets.
The template for this meme is called "stop doing math".
I have no idea at all of what this is about but I feel strongly that OP is right and we must urgently fix this disgusting problem we are facing with the interfaces. Get em, OP, get the bastards. Solidarity
It's amazing how many linux problems stem from 'Redhat, however, found this solution too simple and instead devised their own scheme'. Just about every over complex, bloated bit of nonsense we have to fight with has the same genesis.
The predictable interface naming has solved a few issues at work, mainly in regards to when we have to work with expensive piece-of-shit (enterprise) systems, since they sometimes explode if your server changes interface names.
Normally wouldn't be an issue, but a bunch of our hardware - multiple vendors and all - initialize the onboard NIC pretty late, which causes them to switch position almost every other boot.
I've personally stopped caring about interface names nowadays though, I just use automation to shove NetworkManager onto the machine and use it to get a properly managed connection instead, so it can deal with all the stupid things that the hardware does.
Redhat, however, found this solution too simple and instead devised their own scheme for assigning network interface names. It fails at solving the problem it was created to solve
I somehow first read "Redhat" as "Reddit" in this sentence, and so was briefly thinking that perhaps this bad idea originated there 😂
As someone who worked on a pre-systemd linux system with multiple NICs and needed them all configured automatically from an OS image based on where it was in the rack, I can't stress enough how good deterministic interface names are.
Booting up a system and each time having different names for each NIC was a nightmare.
Frankly 90+% of what systemd has done is tremendously positive and makes linux a better operating system to use, both for sys admins and end users.
"the order in which the system discovered it" is not deterministic
This is the same problem they had with hard drive names and it seems to have been solved in a sensible way, i.e. /dev/sda still points to the first disk detected by the system, but you can look look in /dev/disk/by-path (or by-uuid, etc) to see the physical address of the devices on the system and what they are symlinked back to, and set your fstab or mdadm arrays to be configured based on those unique identifiers instead.
So, I guess what I'd like to know is why hasn't this been solved the same way? When you boot up they should present every hard wired Ethernet port as ethX, and the hardware address interface should be present as well but aliased back to the eth. Then you can build the your network configs based on either one.
To disable predictable interface naming and switch back to the old scheme, add net.ifnames=0 and biosdevname=0 to your boot paramets.
What is the old scheme? This?
The solution to this issue is to assign custom names based on MAC address. The MAC address is hardcoded into the network adaptor, and will not change. (There are other ways to do this as well, such as setting udev rules).
Does that mean that until you name something it's unusable?
I really appreciate this change. Prior to it was always a struggle to deploy servers successfully. You'd reboot and your database would be on the wrong interface and you could even remote in because the management interface was suddenly on a firewalled external only network. Ask me how I know.
With virtualization and containers this just got more complicated. I would constantly have to rewrite kvm entire configs because I'd drop a new nic in the machine. A nightmare.
Sure, it's gibberish for the desktop user but you can just use the UI and ignore the internal name. Not even sure the last time I saw it on my laptop. So no big deal.
I had to change mine to mac address naming on my proxmox server after the second time the name changed due to a GPU or SSD being added. It was kind of like, so what, if an SSD dies suddenly or I have some issue with a device you are going to rename my fucking nic card again while I am trying to troubleshoot? Absolutely deranged.
I always just derive the interface name from first principles. Like, if I want to know which interface will be used to get out to the internet in a script, I'll just find the one that's L2 adjacent with the default gateway. If I'm given an egress or cidr, I'll just find the interface that has that IP. Modern iproute2 has a JSON output option which makes getting this information pretty trivial. Doing that means that it doesn't matter what scheme your OS is using.
I personally prefer the persistent names for Ethernet, although I don't like them for WiFi. Luckily, it seems like my wireless adapter always just ends up as wlan0. I'm not sure why that's the case, but it works out well in the end for me.
So I do HPC installations, and using Mellanox/NVIDIA adapters in Ethernet mode absolutely sucks. First, when you initially install them, they’re named something like ens2f0, where “2” generally corresponds to the PCI slot. Pretty easy, until you install MOFED. Yeah, I know you don’t need MOFED, but the drivers included in RHEL are waaay old. Anyway, after installing the newer drivers, that exact same interface becomes ens2f0np0!
What’s even better is there’s no guarantee that a PCI Ethernet card in PCI slot 2 will be “ens2…” which I would argue is predictive!
No idea what mactab is, but maybe it solves it for me, but being able to go from interface name back to a rack full of heterogeneous PCI cards and go "yep it should be this port" was a wildly useful feature.
I feel like there should be automatic alias creation for simply interface names though.