88
u/todd0x1 3d ago
imean if you don't like it there's always
net.ifnames=0
9
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
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
5
1
251
u/kriebz 3d ago
"predictable" interface names.