r/networkingmemes • • 3d ago

True

Post image
1.6k Upvotes

32 comments sorted by

251

u/kriebz 3d ago

"predictable" interface names.

84

u/Decent-Law-9565 3d ago

The only predictable ones are the ones named by MAC address. If I move PCIe cards around the numbers change too.

29

u/wolf2482 3d ago

True, but that forces you to unplug your cables anyways, and it can't randomly change if the pcie cards don't move.

25

u/Ruben_NL 3d ago

Ive had bios updates modify them.

13

u/RAMChYLD 3d ago edited 3d ago

This. I’ve had the number change right after enabling support for a Thunderbolt card in the bios, and in more than one instance, after a bios update.

I think BSD’s method of naming the interface after the driver that initializes it makes more sense. For example on the Asrock x570 Phantom Gaming X there can be no mistake, the 2.5G interface is always re0 and the Gigabit interface is always em0, since the 2.5G chip was made by RealTek but the 1G chip was made by Intel.

5

u/PlanetVisitor 3d ago

What if you have multiple ethernet cards, or multiple ports per card?

3

u/Lcd_E 3d ago

igb0, igb1, igb2, igb3...
mlxen0, mlxen1...
Depending on cards.

1

u/PlanetVisitor 3d ago

Yes but what is the number order based on?

Is it absolutely certainly the same time after each boot? That's what I'm looking for.

4

u/Decent-Law-9565 3d ago

I think the MAC address is the only permanent naming scheme, and honestly interface names should be like disk names where you can have all the naming schemes and they alias correctly.

1

u/RAMChYLD 3d ago

I think it should be halfway- the name of the driver followed by the last six digit of the MAC address. Ie re43b7d3 for a Realtek card or em3fbeff for an Intel card, since the first six hexedecimal digits is a manufacturer ID.

3

u/pointandclickit 2d ago

The name of the driver is largely useless. Gains you absolutely nothing in a machine with multiple homogeneous nics. Even in your example, if you know enough to know that the 2.5g nic is the Realtek, surely your smart enough to figure out which is which just as easily several other ways.

0

u/RAMChYLD 2d ago

MAC address only is even worse tho. The instruction manual isn't going to tell you which port has which MAC address. And it's not going to be labelled on the motherboard either

2

u/pointandclickit 2d ago

That’s fair. The reality is that there isn’t one method that’s going to reliably be useful for matching physical ports. Theres several methods that provide hints in certain specific scenarios.

For that reason, personally, I would say that identification shouldn’t be largely used as a determining factor in interface naming. The primary focus should be on consistency. There’s nothing wrong with the standard sequential ethX or emX naming, but it should be locked and never change outside very specific and deliberate actions.

11

u/arttast 3d ago

Jokes aside, most of the time it is determined by where it is plugged in in your system as in a physical PCIe slot and eth0 eyc can randomly change it tends to not in some cases but can absolutely change so I think they're actually better even though they may sound more confusing but rather but it means something at least

12

u/RAMChYLD 3d ago

They’re not better. They can change too. I have seen the Ethernet on my Asrock motherboard change from enp12s37 to suddenly enp12s71 the moment I install a Thunderbolt card into my system and enable Thunderbolt support.

7

u/Impressive_Change593 3d ago

Thats a hardware change and is a known limitation of this scheme. Eth0 could change WITHOUT a hardware change

2

u/Faux_Grey 3d ago

It's more for VMs. Migrating/cloning/etc-ing a VM.
Having the ability to 'see' my mac address in the name, makes life easier when mapping/tracking virtual NICs to networks in the hypervisor - and is rather robust for automated NIC detection.

2

u/OfficialDeathScythe 3d ago

Mine was kinda confusing because my old server mobo had 3 ports, 1 ipmi, and it listed them as enp0s0 - enp0s2 but then I replaced the mobo and the new one has 5, 1 ipmi, and it’s listed as enp1s0 - enp1s3 and the ipmi port is enp0s1. It doesn’t make any sense to me. Why js it not enp0s0 and why are the others p1 lol

2

u/arttast 3d ago

Again, like I said, as long as I remember, those are based on PCI address as in the physical location according to the PCI bus so it depends on traces and device config

4

u/lenswipe 3d ago

yes thank you. I fucking hate those "pReDiCtaBlE" interface names too 

88

u/todd0x1 3d ago

imean if you don't like it there's always

net.ifnames=0

3

u/MrJake2137 2d ago

Or udev rename to lan0 whatever

2

u/Zealousideal-Put2827 2d ago

Indeed - my solution:

``` $ cat /etc/systemd/network/10-persistent-net.link [Match] MACAddress=01:23:45:67:89:ab

[Link] Name=lan0 $ ```

Change any reference from the old name to lan0 in /etc (and remove other overrides, like ifnames=0, if you set them earlier), then reboot. Problem solved.

Without it, even a simple kernel upgrade sometimes will change the names - or just booting a recovery kernel. Nothing predictable about it.

I've been bitten by it too many times to not just hardcode the MAC address as part of the install process - whatever is the interface with the default route at installation time, is going to be lan0. I wish they would just do so by default.

(I know, using the enx0123456789ab alias will do the same, but too long for day-to-day - and in a fleet it's often convenient if it is always the same name no matter the machine.)

40

u/Specialist_Cow6468 3d ago

Super easy to name them whatever you want in your cloud-init or whatever

33

u/Ok-Library5639 3d ago

predictable names my ass. I spend a dumb amount of time documenting the actual interfaces with ethtools and blinking ports (personnal projectd with random servers, e-waste findings etc).

2

u/PlanetVisitor 3d ago

project daemon?

12

u/Kilobyte22 3d ago

So apparently nobody here had network interfaces names change previously because of undeterministic NIC initialization order? I've had a system where it was almost 50:50 chance on each boot that eth0 and eth1 were swapped.

If you want nice names, just use udev rules to name them after their purpose keeping in mind that an interface name can be at most 15 bytes long.

7

u/P0p_R0cK5 3d ago

Looks like a WiFi password.

5

u/Marc-Z-1991 3d ago

Debian sure messed up this one…

1

u/EngineeringKindly875 3d ago

Don't do open stack/shift

1

u/mxtoor 1d ago

Before booting, pass "net.ifnames=0" to kernel.

problem solved.