<div dir="ltr"><div>Hi Silvio, <br></div><div><br></div><div>Thank you for this information. Unfortunately, this does not seem to have the uniquely identifiable information I can use to consistently match the devices. See below. <br></div><div><br></div><div>root@av20-mvc-01:~# lspci -d:"$marvell_device_id"<br>04:00.0 Ethernet controller: Marvell Technology Group Ltd. Device 0f13 (rev 01)<br>05:00.0 Ethernet controller: Marvell Technology Group Ltd. Device 0f13 (rev 01)<br></div><div><br></div><div>root@av20-mvc-01:~# udevadm info /sys/class/net/eno2 <br>P: /devices/pci0000:00/0000:00:10.0/0000:04:00.0/net/eno2<br>L: 0<br>E: DEVPATH=/devices/pci0000:00/0000:00:10.0/0000:04:00.0/net/eno2<br>E: INTERFACE=eno2<br>E: IFINDEX=3<br>E: SUBSYSTEM=net<br>E: USEC_INITIALIZED=8220209<br>E: ID_NET_NAMING_SCHEME=v245<br>E: ID_NET_NAME_MAC=enx02000000000b<br>E: ID_NET_NAME_ONBOARD=eno2<br>E: ID_NET_LABEL_ONBOARD=Onboard ETHERNET Controller<br>E: ID_NET_NAME_PATH=enp4s0<br>E: ID_BUS=pci<br>E: ID_VENDOR_ID=0x11ab<br>E: ID_MODEL_ID=0x0f13<br>E: ID_PCI_CLASS_FROM_DATABASE=Network controller<br>E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller<br>E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.<br>E: ID_PATH=pci-0000:04:00.0<br>E: ID_PATH_TAG=pci-0000_04_00_0<br>E: ID_NET_DRIVER=oak<br>E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link<br>E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eno2<br>E: TAGS=:systemd:<br> </div><div>root@av20-mvc-01:~# udevadm info /sys/class/net/mvc-sw1 <br>P: /devices/pci0000:00/0000:00:11.0/0000:05:00.0/net/mvc-sw1<br>L: 0<br>E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:05:00.0/net/mvc-sw1<br>E: INTERFACE=mvc-sw1<br>E: IFINDEX=4<br>E: SUBSYSTEM=net<br>E: USEC_INITIALIZED=8376130<br>E: ID_NET_NAMING_SCHEME=v245<br>E: ID_NET_NAME_MAC=enx02000000000c<br>E: ID_NET_NAME_PATH=enp5s0<br>E: ID_BUS=pci<br>E: ID_VENDOR_ID=0x11ab<br>E: ID_MODEL_ID=0x0f13<br>E: ID_PCI_CLASS_FROM_DATABASE=Network controller<br>E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller<br>E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.<br>E: ID_PATH=pci-0000:05:00.0<br>E: ID_PATH_TAG=pci-0000_05_00_0<br>E: ID_NET_DRIVER=oak<br>E: ID_NET_LINK_FILE=/etc/systemd/network/10-oxb-mvc-sw1.link<br>E: ID_NET_NAME=mvc-sw1<br>E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/mvc-sw1 /sys/subsystem/net/devices/mvc-sw1<br>E: TAGS=:systemd:</div><div><br></div><div>The PCI bus seems to be the only unique information point, but as I explained, this changes on power cycle with the hotswop board plugged in and not. <br></div><div><br></div><div>Looking at the output now I see that the first device is named by default link file and I might be able to use the OriginalName to match on. I'm going to try and remove all the networking configuration in /etc/systemd/network/ and see what device names come up as those might be more consistent and can be used. <br></div><div><br></div><div>I will test and provide feedback. <br></div><div><br></div><div>Kind regards</div><div>Henti <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 13 Aug 2024 at 18:04, Silvio Knizek <<a href="mailto:killermoehre@gmx.net">killermoehre@gmx.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am Dienstag, dem 13.08.2024 um 17:16 +0100 schrieb Henti Smith:<br>
> Good day everybody. <br>
> <br>
> I've searched high and low and cannot seem to find an answer for what I'm trying to do. The most relevant I found was this [1] thread in 2020, but only because I'm using a script to change the contents of my .link files during boot, which is not working constantly. <br>
> <br>
> Some things to note: <br>
> 1. The hardware is sample hardware so Mac addresses are 00:00:00:00:00.<br>
> 2. The hardware has an external hot-swap PCId port that takes a board for VGA out. <br>
> 3. We're attempting to configure two interfaces.<br>
> <br>
> The problem is when the board is attached the PCI numbering of the two interfaces change. With the board attached, it's 5 and 6, without it 4 and 5. <br>
> <br>
> Normally this would not be a problem, since you can Match on mac address, but in this case, both have the same mac address of 00:00:00:00:00. <br>
> <br>
> My attempt to fix this was to create a script [2] that enumerated the PCI ports for the hardware manufacturer and use that information to update the link files [2] before systemd-networkd starts, but this does not work constantly. <br>
> <br>
> Are there any other recommendations to resolve this situation or if my approach is the only real way to do this, how can I ensure my script is executed before systemd uses the link files to apply the interface configuration ? <br>
> <br>
> [1] <a href="https://lists.freedesktop.org/archives/systemd-devel/2020-June/044784.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/archives/systemd-devel/2020-June/044784.html</a><br>
> [2] <a href="https://paste.mozilla.org/jgcCyo9A" rel="noreferrer" target="_blank">https://paste.mozilla.org/jgcCyo9A</a><br>
> [3] <a href="https://paste.mozilla.org/zXQYpXpd" rel="noreferrer" target="_blank">https://paste.mozilla.org/zXQYpXpd</a><br>
> <br>
> Any guidance would be most welcome. <br>
> <br>
> Kind regards<br>
> Henti Smith<br>
<br>
Hi Henti,<br>
<br>
you can [Match] onto basically everything provided by `udevadm info /sys/class/net/<device_name>`.<br>
<br>
See `man:systemd.link` for further information.<br>
<br>
BR<br>
Silvio<br>
</blockquote></div>