[systemd-devel] Updating network file during boot
Henti Smith
henti at gaydonsmith.co.uk
Wed Aug 21 15:57:35 UTC 2024
cOn Fri, 16 Aug 2024 at 15:39, Henti Smith <henti at gaydonsmith.co.uk> wrote:
> On Fri, 16 Aug 2024 at 07:31, Andrei Borzenkov <arvidjaar at gmail.com>
> wrote:
>
>>
>> echo 'SUBSYSTEM=="net", KERNELS=="0000:00:10.0", NAME="mvc-sw1"' >
>> /etc/udev/rules.d/mvc.rules
>> echo 'SUBSYSTEM=="net", KERNELS=="0000:00:11.0", NAME="mvc-sw2"' >>
>> /etc/udev/rules.d/mvc.rules
>>
>
> Thank you, this worked for me.
>
> I've updated my config to use the udev method, however can anybody explain
> to me what I did wrong with the systemd.link method ?
>
> Based on the man page using Property=Path=pci-0000:05:00.0 Driver=oak
> should have worked to match the PCI address and the driver should it not ?
>
Good day everybody.
Thank you again for the solution as noted above
After adding some more network devices to udev this way I now have the same
udev configuration working intermittently and I'm not sure why. To create a
complete picture I'll attach a collection of log files.
The zip contains two sets of logs from syslog and lshw when the udev works
and when it doesn't. It's the same physical hardware without any changes
and the udev file is exactly the same as well. I'll show some brief bits
below:
The udev file in question is as follows:
# Custom naming and Administratively-local MAC address for the two 10Gbit/s
link to the Pony Gemini switch.
# This ensures consistent naming and ordering regardless of whether the
local debug board is attached.
# It also means we don't need .link files in /etc/systemd/network for these
two.
SUBSYSTEM=="net", KERNELS=="0000:00:0d.0", NAME="eno1"
SUBSYSTEM=="net", KERNELS=="0000:00:0c.0", NAME="debug1"
SUBSYSTEM=="net", KERNELS=="0000:00:10.0", NAME="mvc-sw1", RUN+="/sbin/ip
link set dev mvc-sw1 address 02:00:00:00:05:00"
SUBSYSTEM=="net", KERNELS=="0000:00:11.0", NAME="mvc-sw2", RUN+="/sbin/ip
link set dev mvc-sw2 address 02:00:00:00:06:00"
debug1 is the PCIe debug board that attaches to a hotplug port on the
device to allow d-sub video access to the device, otherwise the device is
headless.
We found that eno1 changes depending on when the debug board (debug1) is
plugged in and not, so the additions are to ensure consistent device naming
with it plugged in and not.
The udev file stat is:
root at av20-mvc-01:~# stat /lib/udev/rules.d/10-mvc-network.rules
File: /lib/udev/rules.d/10-mvc-network.rules
Size: 651 Blocks: 8 IO Block: 4096 regular file
Device: fd01h/64769d Inode: 537062519 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2024-08-21 13:26:57.914234146 +0000
Modify: 2024-08-20 15:42:33.749953979 +0000
Change: 2024-08-21 13:26:52.410092798 +0000
Birth: -
And afterwards I rebooted and shutdown the device several times and the
resulting state was logged as follows:
2024-08-21T13:26:57.817412+00:00 av20-mvc-01 reboot
: success
2024-08-21T13:29:05.833134+00:00 av20-mvc-01 shutdown -h 0 now : fail
2024-08-21T13:33:23.672549+00:00 av20-mvc-01 reboot
: success
2024-08-21T13:38:06.665489+00:00 av20-mvc-01 shutdown -h 0 now : fail
2024-08-21T13:47:04.809970+00:00 av20-mvc-01 reboot
: fail
2024-08-21T14:20:11.638717+00:00 av20-mvc-01 reboot
: success
The syslog when the configuration worked is:
2024-08-21T13:19:07.318117+00:00 av20-mvc-01 systemd-networkd[1128]: eno1:
Interface name change detected, eno1 has been renamed to debug1.
2024-08-21T13:19:07.318119+00:00 av20-mvc-01 systemd-networkd[1128]: eth1:
Interface name change detected, eth1 has been renamed to eno1.
2024-08-21T13:19:07.315466+00:00 av20-mvc-01 systemd-networkd[1128]: eno1:
Link UP
2024-08-21T13:19:07.319214+00:00 av20-mvc-01 kernel: [ 4.601186] igb
0000:01:00.0 eno1: renamed from eth0
2024-08-21T13:19:07.319368+00:00 av20-mvc-01 kernel: [ 8.331511] igb
0000:01:00.0 debug1: renamed from eno1
2024-08-21T13:19:07.319378+00:00 av20-mvc-01 kernel: [ 8.374580] igb
0000:02:00.0 eno1: renamed from eth1
2024-08-21T13:19:07.319396+00:00 av20-mvc-01 kernel: [ 8.611432] 8021q:
adding VLAN 0 to HW filter on device eno1
2024-08-21T13:19:07.319396+00:00 av20-mvc-01 kernel: [ 8.611927] igb
0000:02:00.0 eno1: igb: eno1 NIC Link is Up 1000 Mbps Full Duplex, Flow
Control: RX/TX
2024-08-21T13:19:07.854869+00:00 av20-mvc-01 systemd-networkd[1128]: eno1:
Gained carrier
and when it failed:
2024-08-21T12:51:43.264195+00:00 av20-mvc-01 systemd-networkd[1130]: eno1:
Link UP
2024-08-21T12:51:43.264214+00:00 av20-mvc-01 systemd-udevd[1037]: eth1:
Failed to rename network interface 3 from 'eth1' to 'eno1': File exists
2024-08-21T12:51:43.264217+00:00 av20-mvc-01 systemd-udevd[1134]: eno1:
Network interface 'eno1' is already up, cannot rename to 'debug1'.
What am I doing wrong here or what do I need to do differently to ensure
that eno1 and debug1 are consistently named correctly ?
Kind regards
Henti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20240821/bbc5ded7/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.zip
Type: application/zip
Size: 7869 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20240821/bbc5ded7/attachment.zip>
More information about the systemd-devel
mailing list