4 ms·
I know exactly what enpXsY is at a glance, and you can too! It's predictable device naming and it helps a system administrator know what NIC they're dealing wit
by eropple 5y ago
I know exactly what enpXsY is at a glance, and you can too! It's predictable device naming and it helps a system administrator know what NIC they're dealing with at a glance. "enp2s0" is "en" (Ethernet; there's "wl" for WLAN and "ww" for WWAN), "p2" (PCIe bus 2), "s0" (PCIe slot 0). They can also be named "enoX" if the system knows that it's integrated/onboard, though this is rare, and hotplug PCIe devices read as "ensX".
https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ https://www.freedesktop.org/wiki/Software/systemd/Predictabl...
On systems that historically have not used this, it was possible for devices to be non-deterministically assigned to eth0, wlan0, etc. -- and while you could say "just pick a guaranteed order", that violates the principle of least surprise. Predictable device naming is the same, everywhere, on the same hardware.
You can still set aliases if you're more comfortable with that, but this is a really sane default.
- kop316 5y agoThank you for the thoughful response on this. TIL.
- jeffbee 5y agoThis isn’t as consistent as you’re making it seem. I added an add-in PCIe Ethernet adapter and it became enp5s0 while the on-board Realtek formerly known as enp5s0 got bumped to enp6s0.
- eropple 5y agoYour hardware is reporting that peripherals have logically moved, so yeah, the names change? It's definitely not perfect, but also consider that this is in part to help manage larger fleets of systems, and if you have thirty of the same machine and you put thirty add-in PCIe ethernet cards into them, at least they'll all predictably change and so in your test lab (you got a test lab for this hypothetical fleet, right?) you'll know what your changes are causing and be able to roll out synchronized software changes to pick up on it. We don't all have fleets of machines, of course, and systemd has functionality for disambiguation in a single-system environment where interfaces might appear and disappear sometimes. udev also has a mode where the interface is automatically named after its MAC rather than its physical location. It's not on by default on any Linux distro I know of, but it's just a flag IIRC.
- ricktdotorg 5y agoreally good, measured & insightful replies. thank you!
- jeffbee 5y agoI just went through a lengthy diagnosis of systems that weren't optimal because something in systemd was trying to match devices prefixed by "pci/" and udev formats the device path as "pci-" so I am kinda not ready to talk about my trauma yet.
- ethbr0 5y ago"Well there's your problem right there. Some damn fool over rotated your trailing character by 45°!"
- immibis 5y agoBeing hardware or software makes no difference: the fact is that network adapters still change names, but now you can't assume the default is eth0 on most systems.
- eropple 5y agoThe idea of a "default" interface for a particular physical transport is worth examining for coherency, I think. If you only have one adapter, then it's the one that shows up when you list your interfaces, so script to that end. If you have more than one, then trusting an ordering that can change on boot is unsafe. But don't worry - those of such a soberly considered persuasion can just use the configuration management they've definitely built and that necessitates such assumptions as "there's always an eth0" to bring it back.
- r1ch 5y agoI remotely installed a firmware update on a Broadcom NIC and the server rebooted with completely different device names and no networking. Thankfully I could still access OOB management. It was definitely a shock to see how fragile the new naming scheme is.
- easytiger 5y agoYea having worked on systems with a dozen NICs in bonded configuration the naming scheme is such a time saver
- josephcsible 5y agoWell it's "predictable" from that perspective, sure. But from my perspective, I used to be able to predict that the first (often only) Ethernet NIC in a host would be "eth0", and now I can't.
- eropple 5y agoIf you have many similarly configured systems: you'll have a test bench to write your configuration management against. If you only have one: en-tab.
- josephcsible 5y ago> If you only have one: en-tab. Funny you should say that, because on one of my computers, the NIC's "predictable" name is just "p1p1" for some reason.
- eropple 5y agoHuh, I've never seen that. That sucks. If you only have one NIC at all, 'tab' will do it too. ;) But also, like, if you have a weirdo computer, you can also fix the weirdo and keep on trucking.
- teddyh 5y agols -d /sys/class/net/en*|head -1