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 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.
eth0? No no, we need wlps0n1pn2d4es6vsd9c69420
Thanks for this post. I’ve been working with Interfaces on Red Hat nodes this week and I’ve already wondered what the hell is going on there.
Small world thinking. Because you haven’t seen the need for it doesn’t mean it doesn’t exist. Also, did you lose your CTRL, C, and V keys?
Yes, because everyone has need of this solution, and wants to have to copy and paste interface names every time they need to touch them, rather than having deterministic naming be an option to enable for those who actually need it…
You know Linux isn’t just used by nerdy kids cosplaying as Mr Robot, right?
You know Linux isn’t just used by enterprise sysadmins, right?
And even speaking as an enterprise sysadmin myself, I’ve not had need or use for deterministic interface naming once in my career. I have no clue how common that is, but most of the servers, both physical and virtual, that I’ve worked on only had one Ethernet port connected.
I see the purpose of this, but don’t see a reason why it should be the default, or why it couldn’t have been implemented like HHD/SSD UUIDs where the old dev names were left intact for easy use outside of fstab and the like where consistency could become a problem
ETA: you also seemed to miss the part of my initial reply to you about it being something that can be enabled by those who need it… And if you’re going to say that the enterprise professionals who need it shouldn’t have to turn it on every time they spin up a system, I’ll remind you that enterprise admins working at that level where they’re setting up enough servers for that to be a hassle are probably using orchestration like Ansible, Chef, or Puppet, and can just add that into their configs once
TLDR
And I don’t care, so whatever
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
Solidarity, Reg.
Was that a terry pratchett reference?
Life of Brian
Having no idea what this is about and being on a Linux meme subreddit is absolutely peak Lemmy.
I miss seeing this meme format on Lemmy. It’s so good, and this one is no exception.
Thanks! I love this format so much. I can’t find it now, but one of my favourite memes in this genre was something like this:
STOP DOING
- Tasks were never meant to be completed
- Years of working, but there’s STILL MORE SHIT TO DO
- Wanted to get some work done anyway, for a laugh? We had a tool for that: it was called SIMULATION GAMES
- “Please let me sacrifice a third of my life to justify my existence. Please let me spend eight hours a day working just to be able to do it again the next day” - statements dreamt up by the utterly deranged
Look at what people have been demanding our respect for all this time, with all the schedules and todo lists we have built for them:
These are REAL things done by REAL people
<Pictures of gmail, microsoft outlook, and some TODO list app>
They have played us for absolute fools
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.
Couldn’t they be configured to always set each interface to a particular name? I’d think that would be the better solution anyway…
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!
“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 theeth
. Then you can build the your network configs based on either one.Shouldn’t be that hard right?
And at least in some distributions, they do exactly that, a number of aliases for the same interface. And you can add your own.
But nobody uses /dev/sdX anymore (not after they wipe the wrong disk once anyway). They either use logical UUIDs or hardware WWN/serial.
idk man I use /dev/sdX when running commands interactively and PARTLABELs in my
/etc/fstab
. All those letters and numbers in UUIDs are too much for my monkey brain to handle lolYeah, the point is “you can use either one”, instead of “we made the choice for you”
Cries in
nvme1n1p6
, which is my current OS partition.Taking a sip of Rum and chuckles at the look on the name of my OS partition:
/dev/mapper/vg-root
and/dev/mapper/vg-home
🙃That’s because you’re using LVM though. In most distros you could also use something like:
/dev/vg/root
As a data center engineer of 10+ years, I struggled to understand this at first. In my world, the hardware does a POST before the OS boots and has an inventory of what hardware components are available, so it shouldn’t matter in what order they are discovered, since the interface names should make a correlation between the interface and the pcie slot that NIC exists in.
Where the water gets muddled is in virtualized servers. The NICs no longer have a correlation to a specific hardware component, and you may need to configure different interfaces in the virtualized OS for different networks. I think in trying to create a methodology that is agnostic to bare metal/virtualized OSs, it was decided that the naming convention should be uniform.
Probably seems like bloat to the average admin who is unconcerned with whether these NICs are physical or virtual, they just want to configure their server.
I actually prefer the eth0 and wlan0.
For regular PCs or laptops, which generally have at most one of each type of adapter, I don’t see any reason not to.
That’s what the meme is saying too
Is it though? Normally it’s ironic: https://knowyourmeme.com/memes/stop-doing-math
This time it isn’t (I think)
Also, make sure your password contains L’s, 1’s, 0’s and O’s in a font deliberately chosen to make them hard to tell apart.
life-long Kali fan
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.
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.
I laughed so hard. Then I cried remembering good old days of
eth0
.Holy shit. I must be really old.
I laughed but now that I know it I’m going to change the udev rules back to eth0.