<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 21, 2015 at 12:40 AM, Lennart Poettering <span dir="ltr"><<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Wed, 15.04.15 01:08, Andrew Cooks (<a href="mailto:acooks@linux.com">acooks@linux.com</a>) wrote:<br>
<br>
> On Tue, Jan 13, 2015 at 6:46 AM, Jan Engelhardt <<a href="mailto:jengelh@inai.de">jengelh@inai.de</a>> wrote:<br>
><br>
> ><br>
> > On Monday 2015-01-12 18:29, Tom Gundersen wrote:<br>
> > >> In systemd-218, I have configured the following testcase:<br>
> > >><br>
> > >> /etc/systemd/network# ls -al<br>
> > >> total 20<br>
> > >> drwxr-xr-x 2 root root 4096 Jan 11 18:14 .<br>
> > >> drwxr-xr-x 5 root root 4096 Jan 11 16:23 ..<br>
> > >> -rw-r--r-- 1 root root   96 Jan 11 18:14 99a-ether.link<br>
> > ><br>
> > >Hm, isn't this just a problem of 99a-ether.link being ordered after<br>
> > >99-default.link?<br>
> ><br>
> > Well, the manpage states: "All link files are collectively<br>
> > sorted and processed in lexical order", with that, I would assume<br>
> > that 99a, being processed after 99, would override 99.<br>
> ><br>
> > >It works for me when naming it 98-ether.link instead.<br>
> ><br>
> > Not in my case. I have a feeling networkd won't touch<br>
> > [08:00:27:0a:c5:b2]'s interface name because it has already<br>
> > been named by udev to enp0s3 before networkd got a chance to run.<br>
> > Could that be it?<br>
<br>
</span>Note that networkd doesn't rename interfaces, only udev does.<br>
<br>
udev implements .link processing, nothing else.<br>
<span class=""><br>
> I'm having a similar problem while running systemd version-219. Did you<br>
> work out what was wrong?<br>
<br>
</span>Maybe this is debian and the saving of interface names is still in<br>
place?<br></blockquote><div><br></div><div>Nope, sorry, this is based on yocto. The good news is that all legacy stuff can be safely ignored.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> # cat /etc/systemd/network/01-mgmt.link<br>
> [Match]<br>
> Path=pci-0000:01:00.0<br>
> Type=ether<br>
><br>
> [Link]<br>
> Name=mgmt<br>
> MACAddressPolicy=persistent<br>
<br>
</span>Consider testing the .link file with "udevadm test-builtin<br>
net_setup_link..."</blockquote><div> </div><div>Thanks, this is exactly what I needed to find the problem.<br></div><div><br></div><div>There were two issues with my .link file:</div><div>I needed to call my local override 100-mgmt.link instead of 01-mgmt.link. IMHO, the ordering of the .link files is somewhat unfortunate, even though the documentation did try to explain it.</div><div><br></div><div>Secondly, the Path in the [Match] section was wrong. The examples use pci-0000:xx:yy.0-* and 'udevadm info /sys/class/net/enp1s0' shows 'ID_PATH=pci-0000:01:00.0' (exactly what I used, as the man page instructs), but it only started working when I tried 'Path=*0000:01:00.0*'. </div><div><br></div><div><div># udevadm test-builtin net_setup_link /sys/class/net/enp1s0</div><div>calling: test-builtin</div><div>=== trie on-disk ===</div><div>tool version:          219</div><div>file size:         6685604 bytes</div><div>header size             80 bytes</div><div>strings            1715076 bytes</div><div>nodes              4970448 bytes</div><div>Load module index</div><div>timestamp of '/etc/systemd/network' changed</div><div>Parsed configuration file /etc/systemd/network/enp3s0.link</div><div>Parsed configuration file /etc/systemd/network/enp2s0.link</div><div>Parsed configuration file /lib/systemd/network/99-default.link</div><div>Parsed configuration file /etc/systemd/network/100-mgmt.link</div><div>Created link configuration context.</div><div>device 0xb77f6040 has devpath '/devices/pci0000:00/0000:00:04.0/0000:01:00.0/ne'</div><div>ID_NET_DRIVER=r8169</div><div>device 0xb77f6040 filled with db file data</div><div>device 0xb77f6940 has devpath '/devices/pci0000:00/0000:00:04.0/0000:01:00.0'</div><div>Config file /lib/systemd/network/99-default.link applies to device enp1s0</div><div>ID_NET_LINK_FILE=/lib/systemd/network/99-default.link</div><div>Unload module index</div><div>Unloaded link configuration context.</div></div><div><br></div><div><br></div><div># cat 100-mgmt.link<br></div><div><div>[Match]</div><div>Path=*0000:01:00.0*</div><div><br></div><div>[Link]</div><div>Name=ManagementPort</div><div>MACAddressPolicy=persistent</div></div><div><br></div><div><br></div><div><br></div><div>Thanks for the help, Lennart!</div><div><br></div><div>a.</div></div></div></div>