<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 28 Oct 2024 at 19:24, 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 Montag, dem 28.10.2024 um 17:56 +0000 schrieb Henti Smith:<br>
> On Mon, 28 Oct 2024 at 13:47, Andrei Borzenkov <[<a href="mailto:arvidjaar@gmail.com" target="_blank">arvidjaar@gmail.com</a>](mailto:<a href="mailto:arvidjaar@gmail.com" target="_blank">arvidjaar@gmail.com</a>)> wrote:<br>
> <br>
> > On Mon, Oct 28, 2024 at 3:07 PM Henti Smith <[<a href="mailto:henti@gaydonsmith.co.uk" target="_blank">henti@gaydonsmith.co.uk</a>](mailto:<a href="mailto:henti@gaydonsmith.co.uk" target="_blank">henti@gaydonsmith.co.uk</a>)> wrote:  <br>
> > >  <br>
> > > On Mon, 28 Oct 2024 at 10:38, Andrei Borzenkov <[<a href="mailto:arvidjaar@gmail.com" target="_blank">arvidjaar@gmail.com</a>](mailto:<a href="mailto:arvidjaar@gmail.com" target="_blank">arvidjaar@gmail.com</a>)> wrote:  <br>
> > > >  <br>
> > > > On Thu, Oct 24, 2024 at 6:29 PM Henti Smith <[<a href="mailto:henti@gaydonsmith.co.uk" target="_blank">henti@gaydonsmith.co.uk</a>](mailto:<a href="mailto:henti@gaydonsmith.co.uk" target="_blank">henti@gaydonsmith.co.uk</a>)> wrote:  <br>
> > > > >  <br>
> > > > > Good day everybody  <br>
> > > > >  <br>
> > > > > I have two link files for mvc-sw1 and mvc-sw2.  <br>
> > > > >  <br>
> > > > > `mvc-sw1`<br>
> > > > ><br>
> > > > > ```ini<br>
> > > > > # Fixed MAC and name for eno2 (Switch 1 connection) when debug board is plugged in<br>
> > > > > # Renamed to mvc-sw1 by PCI Address and set custom MAC address.<br>
> > > > > [Match]<br>
> > > > > Property=DEVPATH=/devices/pci0000:00/0000:00:10.0/0000:05:00.0/net/eno2<br>
> > > > > <br>
> > > > > [Link]<br>
> > > > > MACAddress=02:00:00:00:05:00<br>
> > > > > Name=mvc-sw1<br>
> > > > > ```<br>
> > > > > <br>
> > > > > `mvc-sw2`<br>
> > > > ><br>
> > > > > ```ini<br>
> > > > > # Fixed MAC and name for enp6s0 (Block Diagram) when debug board is plugged in<br>
> > > > > # Renamed to mvc-sw2 by PCI Address and set custom MAC address.<br>
> > > > > [Match]<br>
> > > > > Property=DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:06:00.0/net/enp6s0<br>
> > > > > ```<br>
> > > > <br>
> > > > These names are already the result of earlier renamoing. I am not sure systemd/udev/networkd will rename the second time.<br>
> > ><br>
> > > Would that be udev ?  <br>
> > >  <br>
> > > we're trying hard to use systemd for all our network management. If this is not a realistic goal, what is the correct way of managing our network with systemd alongside other tools ?<br>
> > <br>
> > Yes, networkd.link files provide the desired names and naming policy, it is systemd-udevd that applies them.  <br>
> > <br>
> > You need to match on some intrinsic device properties and these rules must be present when systemd-udevd first sees and renames these interfaces. Which often means in initrd/initramfs.<br>
> <br>
> Good evening Andrei, <br>
> <br>
> Where can I find detailed information on where to find the names when systemd-udevd sees the interface for the first time ?<br>
> <br>
> Silvio in my previous mail thread commented that I can use  udevadm info which is what I'm trying to do here. Is there another method to get the "pre systemd" interface names that I should be using ?<br>
> <br>
> I cannot use mac addresses to match on, nor the Path as both are not reliable in my use case, hence using the full DEVPATH from udevadm.<br>
> <br>
> Any assistance will be appreciated.<br>
> <br>
> Kind regards  <br>
> Henti<br>
<br>
Hi,<br>
<br>
why do you use `Property=DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:06:00.0/net/enp6s0` and not `Path=0000:06:00.0`, as stated by <man:systemd.link>?<br></blockquote><div><br></div><div>We have PCI debug boards that get added and removed during use and that increments and decrements the PCI addresses. I have two devices on consecutive PCI addresses but different bus addresses, so I'm trying to match on bus address not the slot address. <br></div><div>The only way I've been able to find to do that is using the full DEVPATH, but for that I need the interface name as well. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

What systemd version do you use, so I can reference online? Also, is your `.link` file applied? What are `networkctl status` and `networkctl status <interface_name>` saying? What says `udevadmin info /sys/class/net/<interface_name>` for all the  interfaces in question?<br></blockquote><div><br></div><div>Focal ubuntu, systemd 245.4</div><div><br></div><div>I'll have to check tomorrow at the office for networkctl status and the udevadm info was in my first mail, but I'll add it below again. <br></div><div><br></div><div>
```<br>P: /devices/pci0000:00/0000:00:10.0/0000:05:00.0/net/eno2<br>L: 0<br>E: DEVPATH=/devices/pci0000:00/0000:00:10.0/0000:05:00.0/net/eno2<br>E: INTERFACE=eno2<br>E: IFINDEX=4<br>E: SUBSYSTEM=net<br>E: USEC_INITIALIZED=8968404<br>E: ID_NET_NAMING_SCHEME=v245<br>E: ID_NET_NAME_ONBOARD=eno2<br>E: ID_NET_LABEL_ONBOARD=Onboard ETHERNET Controller<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-debug.link<br>E: ID_NET_NAME=eno2<br>E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eno2 /sys/subsystem/net/devices/eno2<br>E: TAGS=:systemd:<br>```<br><br>```<br>P: /devices/pci0000:00/0000:00:11.0/0000:06:00.0/net/enp6s0<br>L: 0<br>E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:06:00.0/net/enp6s0<br>E: INTERFACE=enp6s0<br>E: IFINDEX=5<br>E: SUBSYSTEM=net<br>E: USEC_INITIALIZED=8928106<br>E: ID_NET_NAMING_SCHEME=v245<br>E: ID_NET_NAME_PATH=enp6s0<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:06:00.0<br>E: ID_PATH_TAG=pci-0000_06_00_0<br>E: ID_NET_DRIVER=oak<br>E: ID_NET_LINK_FILE=/etc/systemd/network/10-oxb-mvc-sw2-debug.link<br>E: ID_NET_NAME=enp6s0<br>E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp6s0 /sys/subsystem/net/devices/enp6s0<br>E: TAGS=:systemd:<br>```

</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

In the end, if your interface locations or hardware properties are *not* reliable, than *no* automatism in the world would be able to assign static values to them.<br></blockquote><div><br></div>This is what I'm trying to resolve. With and without the debug PCI card I ahve two sets of addresses and if I can create two sets of config to match each, that should work. <br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Henti<br></div></div>