I am using deb 12 with udev and systemd.
My problem is this: I have to deal with an array of lenovo devices (edge se-30) equipped with 2 ethernet ports (maybe more but here I car only about these). Depending on certain optionals of the device purchased that can vary from device to device (additional wlans, additional bluetooth or other things), the network interface names recognized by systemd/udev change. This is expected because this is how systemd/udev works after introduction of consistent naming schema policy some years ago (sometimes enp3s0 and enp8s0, sometimes enp46s0 and enp47s0, or other combinations).
I am fine with this and I don't want to rename to legacy naming schemas now discontinued(eth0).
After machine runs, I have some custom scripts needed to operate on the network interfaces. With the current situation basically what I need to do is: for each specific lenovo device I configure, I need to adjust the scripts (config files) in order to map to the actual network interface name present in that machine. This is a small modification but requires a person to be "trained enough" to know how to do this.
My idea is to modify these custom scripts so that they refer to "networkinterface1" and "networkinterface2" because all the machines I have to deal with do have at these interfaces and they are the only ones I am interested in.
In this way the scripts don't need to be modified every time a new specific lenovo device is configured.
To allow this I was thinking that I need a way to create an alias to the network interface, something like
Code: Select all
# ip link property add dev enp46s0 altname networkinterface1
Can someone suggest some other way, maybe more compliant to the systemd/udev operating model to achieve my goal? The best would be to have something that does automatically adjust, but also a manually setup system would be ok as long as it has to be done once and is maintained across reboots/system ugrades.