> The 30000002 is likely what we'd want to bind to.
Thanks for pointing this out! This sounds like a very good solution, much better than either of the above. If this is stable across reboots and indeed a property of the (virtual) "hardware", then let's use this.
Thus an udev rule like this ought to work, e. g. in /lib/udev/rules.d/76-ibmveth-naming.rules:
This will sort after any existing 70-persistent-net.rules, but before 80-net-setup-link.rules.
So for your example the interface would be called "ibmveth2", and for a device which breaks the "starts with 3" assumption and has e. g. /devices/vio/5000003, it would then be named "ibmveth5000003". If this (not starting with '3') "Should Not Happen™", that's fine, but I'd rather be cautious.
> The 30000002 is likely what we'd want to bind to.
Thanks for pointing this out! This sounds like a very good solution, much better than either of the above. If this is stable across reboots and indeed a property of the (virtual) "hardware", then let's use this.
Thus an udev rule like this ought to work, e. g. in /lib/udev/ rules.d/ 76-ibmveth- naming. rules:
SUBSYSTEM=="net", NAME=="", DRIVERS=="ibmveth", PROGRAM="/bin/sh -ec 'D=${DEVPATH# */vio/} ; D=${D#3}; echo ${D%%%%/*} | sed s/^0*//", NAME="ibmveth$ result"
This will sort after any existing 70-persistent- net.rules, but before 80-net- setup-link. rules.
So for your example the interface would be called "ibmveth2", and for a device which breaks the "starts with 3" assumption and has e. g. /devices/ vio/5000003, it would then be named "ibmveth5000003". If this (not starting with '3') "Should Not Happen™", that's fine, but I'd rather be cautious.