Page 1 of 1
** SOLVED ** systemd-networkd interface name change timing
Posted: Sat Mar 15, 2025 11:48 pm
by JumboAg
Got a weird one on a new SBC board. I'm using systemd, not openrc and configure my static IP with systemd-networkd.
It's failing to find the end0 interface. What's happening is the interface comes up as eth0 and then during boot gets renamed to end0. systemd-networkd appears to be trying to set my IP BEFORE that has finished.
Code: Select all
Dec 20 13:47:34 altapi systemd[1]: Starting Network Configuration...
Dec 20 13:47:34 altapi systemd-networkd[422]: lo: Link UP
Dec 20 13:47:34 altapi systemd-networkd[422]: lo: Gained carrier
Dec 20 13:47:34 altapi systemd-networkd[422]: Enumeration completed
Dec 20 13:47:34 altapi systemd[1]: Started Network Configuration.
Dec 20 13:47:35 altapi systemd-networkd[422]: eth0: Interface name change detected, renamed to end0.
Dec 20 13:47:35 altapi systemd-networkd[422]: end0: Configuring with /etc/systemd/network/50-static.network.
Dec 20 13:47:35 altapi systemd-networkd[422]: end0: Could not bring up interface, ignoring: No such device
Any suggestions on how to get systemd-networkd to wait a couple of seconds to let that name change stabilize? If I restart systemd-networkd after the box is finished booting, end0 gets configured correctly.
Posted: Sun Mar 16, 2025 5:13 am
by rab0171610
In your configuration file (/etc/systemd/network/50-static.network), under the match section [MATCH] you can try matching to the MAC address instead of the interface Name.
Code: Select all
MACAddress=
A whitespace-separated list of hardware addresses. The acceptable formats are:
colon-delimited hexadecimal
Each field must be one byte. E.g. "12:34:56:78:90:ab" or "AA:BB:CC:DD:EE:FF".
Added in version 250.
Keep in mind that:
Code: Select all
A network file is said to match a network interface if all matches specified by the [Match] section are satisfied.
So if I understand it correctly, you would likely want to comment out the 'Name=' line and leave only a 'MACAddress=' line. This should match to the interface with the specified mac address only without consideration for the interface name. Again, that is if I understand correctly.
See:
https://www.freedesktop.org/software/sy ... twork.html
Posted: Sun Mar 16, 2025 2:37 pm
by JumboAg
Tried. No change.
Code: Select all
-- Boot b2d6def317e348118f93a47a6e4cc33d --
Dec 20 13:47:33 altapi systemd[1]: Starting Network Configuration...
Dec 20 13:47:33 altapi systemd-networkd[418]: lo: Link UP
Dec 20 13:47:33 altapi systemd-networkd[418]: lo: Gained carrier
Dec 20 13:47:33 altapi systemd-networkd[418]: Enumeration completed
Dec 20 13:47:33 altapi systemd[1]: Started Network Configuration.
Dec 20 13:47:34 altapi systemd-networkd[418]: eth0: Interface name change detected, renamed to end0.
Dec 20 13:47:34 altapi systemd-networkd[418]: end0: Configuring with /etc/systemd/network/50-static.network.
Dec 20 13:47:34 altapi systemd-networkd[418]: end0: Could not bring up interface, ignoring: No such device
Posted: Sun Mar 16, 2025 2:44 pm
by NeddySeagoon
JumboAg,
Turn off interface renaming.
There is a udev rules file, that must be present but empty, or add
to your kernel command line.
Posted: Sun Mar 16, 2025 6:35 pm
by rab0171610
JumboAg,
Thanks for reporting back that it did not work. It is one of those situations where you think you understand from the documentation how something works in theory but it actually works differently when applied.
I use NetworkManager for network connections. I do not have the issue that you do with renaming enabled. I would still like to know why your configuration fails and what the actual solution is to that problem. If you ever gain any insight or figure out how to get it to work correctly, please post back. I am curious.
Hopefully Neddy's solution will work for you.
Posted: Thu Mar 20, 2025 2:23 am
by JumboAg
NeddySeagoon wrote:JumboAg,
Turn off interface renaming.
There is a udev rules file, that must be present but empty, or add
to your kernel command line.
Closer... but still not working. journald still implies to me that systemd-networkd is getting ahead of the ethernet interface intializing. See below... I manually restart systemd-networkd at 13:49:08 (Dates wrong b/c its a SBC with no hardware clock and no networking to sync NTP. )
Code: Select all
-- Boot 5231bbc8731745a3bfb1aceac8af271c --
Dec 20 13:47:34 altapi systemd[1]: Starting Network Configuration...
Dec 20 13:47:34 altapi systemd-networkd[433]: lo: Link UP
Dec 20 13:47:34 altapi systemd-networkd[433]: lo: Gained carrier
Dec 20 13:47:34 altapi systemd-networkd[433]: Enumeration completed
Dec 20 13:47:34 altapi systemd[1]: Started Network Configuration.
Dec 20 13:47:35 altapi systemd-networkd[433]: eth0: found matching network '/etc/systemd/network/50-static.network', based on potent>
Dec 20 13:47:35 altapi systemd-networkd[433]: eth0: Configuring with /etc/systemd/network/50-static.network.
Dec 20 13:47:35 altapi systemd-networkd[433]: eth0: Could not bring up interface, ignoring: No such device
Dec 20 13:49:08 altapi systemd[1]: Stopping Network Configuration...
Dec 20 13:49:08 altapi systemd[1]: systemd-networkd.service: Deactivated successfully.
Dec 20 13:49:08 altapi systemd[1]: Stopped Network Configuration.
Dec 20 13:49:08 altapi systemd[1]: Starting Network Configuration...
Dec 20 13:49:08 altapi systemd-networkd[589]: lo: Link UP
Dec 20 13:49:08 altapi systemd-networkd[589]: lo: Gained carrier
Dec 20 13:49:08 altapi systemd-networkd[589]: Enumeration completed
Dec 20 13:49:08 altapi systemd[1]: Started Network Configuration.
Dec 20 13:49:08 altapi systemd-networkd[589]: eth0: found matching network '/etc/systemd/network/50-static.network', based on potent>
Dec 20 13:49:08 altapi systemd-networkd[589]: eth0: Configuring with /etc/systemd/network/50-static.network.
Dec 20 13:49:08 altapi systemd-networkd[589]: eth0: Link UP
Dec 20 13:49:11 altapi systemd-networkd[589]: eth0: Gained carrier
Dec 20 13:49:11 altapi systemd-networkd[589]: eth0: found matching network '/etc/systemd/network/50-static.network', based on potent>
Dec 20 13:49:13 altapi systemd-networkd[589]: eth0: Gained IPv6LL
Dec 20 13:49:14 altapi systemd-networkd[589]: eth0: DHCPv6 address xxxxxxxxxxxxxxxxx (valid for 23h 59min 59s, preferred >
Posted: Thu Mar 20, 2025 3:50 am
by rab0171610
You can try to modify the systemd-networkd service and add a sleep command.
Code: Select all
systemctl edit systemd-networkd.service
My default editor is nano. This will open the service file for editing and you will see in the top of file:
Code: Select all
### Editing /etc/systemd/system/systemd-networkd.service.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file
### Edits below this comment will be discarded
### /usr/lib/systemd/system/systemd-networkd.service
You can try adding a line to add a delay with sleep using 5 or 10 seconds for example:
or:
Once the changes are made you may need to run:
to reload the systemd manager configuration.
Also see:
https://github.com/systemd/systemd/issues/7293
Posted: Thu Mar 20, 2025 3:58 pm
by JumboAg
rab0171610 wrote:You can try to modify the systemd-networkd service and add a sleep command.
Code: Select all
systemctl edit systemd-networkd.service
My default editor is nano. This will open the service file for editing and you will see in the top of file:
Code: Select all
### Editing /etc/systemd/system/systemd-networkd.service.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file
### Edits below this comment will be discarded
### /usr/lib/systemd/system/systemd-networkd.service
You can try adding a line to add a delay with sleep using 5 or 10 seconds for example:
or:
Once the changes are made you may need to run:
to reload the systemd manager configuration.
Also see:
https://github.com/systemd/systemd/issues/7293
Close..... It actually required two lines. You need a
tag above the ExecStartPre. Once I added that, it was good to go. I appreciate the assistance. Marking Solved.