<div dir="ltr"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 2, 2020, 16:59 Felix <<a href="mailto:systemd-devel@fj.hamme.net" target="_blank">systemd-devel@fj.hamme.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everybody,<br>
<br>
I'm failing to set an alias for a link using systemd-networkd. Am I<br>
doing something wrong? Is this a bug?<br>
<br>
<br>
I'm on this systemd version:<br>
systemd 244 (244.3-1~bpo10+1)<br>
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP<br>
+LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS<br>
+KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid<br>
<br>
This runs on a Debian Buster inside a virtual machine hosted on a<br>
proxmox 6.1 server, if that matters.<br>
<br>
I'm trying to set an alias for a link using systemd-networkd, following<br>
this documentation:<br>
<a href="https://www.freedesktop.org/software/systemd/man/systemd.link.html#Alias=" rel="noreferrer noreferrer" target="_blank">https://www.freedesktop.org/software/systemd/man/systemd.link.html#Alias=</a> .<br>
I put my file in /etc/systemd/network/, as<br>
-rw-r--r-- 1 root root 56 Mär 2 14:06 ens19.link<br>
with this content:<br>
<br>
```<br>
[Match]<br>
Path=/sys/class/net/ens19<br></blockquote><div><br></div><div>The Path= setting is documented to match against the ID_PATH udev property, not against the list of sysfs paths. (For example udevadm shows "pci-0000:01:00.0" on my machine.)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
[Link]<br>
Alias=myalias<br>
```<br>
<br>
I also tried to replace `Path=/sys/class/net/ens19` with<br>
`MACAddress=be:19:32:ed:c0:61` and `OriginalName=ens19`.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">OriginalName matches the kernel-assigned name (udev property 'INTERFACE'), which is always either eth# or wlan# or usb# or similar.</div><div dir="auto"><br></div><div dir="auto">Names such as ens# or eno# are not original – the interfaces are renamed by udev, and this actually happens *after* applying .link files (as the .link files specify which naming policy to use in the first place.)</div><div dir="auto"><div class="gmail_quote"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
After `systemctl restart systemd-networkd` or even rebooting the alias<br>
is still not set:<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How can I set the link alias using systemd-networkd?<br></blockquote><div><br></div><div><div>.link files are not applied by networkd – they're applied by udev.</div></div><div><br></div></div></div></div>
</div>