systemd.link named interface not editable in webui

fernie

Active Member
Dec 20, 2017
5
1
41
45
Hi,

If I rename physical interface for example from enp5s0 to "lan1" using systemd.link file, proxmox ve webui does not give me edit dialog for this interface. It works with boot parameter net.ifnames=0 (shows up as eth0), so dont know what is so different with this approach. It also shows Type as "Unknown" for the interface.

Everything else seems to work fine, bridging, tagging vlans to vm interfaces etc, so its not much of an issue, just something that noticed and maybe could be addressed in some point in future? Or is there some reason for this to be not valid configuration, that is not immediately obvious for me?

And the reason for doing any of this: consistent naming scheme is not so consistent when you switch in/out pcie devices on the system, so assigning interface name by mac address keeps it always the same.

config:
# cat /etc/systemd/network/10-persistent-lan1.link
[Match]
MACAddress=34:97:f6:54:69:dd

[Link]
Name=lan1
 
And just after I hit post, realized that it might be just the name and some regex on that.

So renaming to ethX works fine with systemd.link, however cannot come up with any meaningful variation that could also indicate the purpose, like eth-lan1 ethlan1 both seem not to work.

systemd.link man page says you should use something different:
Note that specifying a name that the kernel might use for another interface (for example "eth0") is
dangerous because the name assignment done by udev will race with the assignment done by the kernel, and
only one interface may use the name. Depending on the order of operations, either udev or the kernel will
win, making the naming unpredictable. It is best to use some different prefix, for example
"internal0"/"external0" or "lan0"/"lan1"/"lan3".
 
Found away around this, pve webui seems to work with enxWHATEVER (mac naming policy), so abusing that with:
[Link]
Name=enxlan1
AlternativeName=lan1

and assigning alt name can quickly identify and operate on the "lan1", now with meaningful and consistent name, this is fine :)
 
  • Like
Reactions: guerreroc12495