Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
** SOLVED ** systemd-networkd interface name change timing
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 213
Location: Dallas, TX

PostPosted: Sat Mar 15, 2025 11:48 pm    Post subject: ** SOLVED ** systemd-networkd interface name change timing Reply with quote

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:

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.


Last edited by JumboAg on Thu Mar 20, 2025 3:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 496

PostPosted: Sun Mar 16, 2025 5:13 am    Post subject: Reply with quote

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:
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:
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/systemd/man/latest/systemd.network.html
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 213
Location: Dallas, TX

PostPosted: Sun Mar 16, 2025 2:37 pm    Post subject: Reply with quote

Tried. No change.

Code:
-- 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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55111
Location: 56N 3W

PostPosted: Sun Mar 16, 2025 2:44 pm    Post subject: Reply with quote

JumboAg,

Turn off interface renaming.

There is a udev rules file, that must be present but empty, or add
Code:
net.ifnames=0
to your kernel command line.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 496

PostPosted: Sun Mar 16, 2025 6:35 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 213
Location: Dallas, TX

PostPosted: Thu Mar 20, 2025 2:23 am    Post subject: Reply with quote

NeddySeagoon wrote:
JumboAg,

Turn off interface renaming.

There is a udev rules file, that must be present but empty, or add
Code:
net.ifnames=0
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:
-- 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 >
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 496

PostPosted: Thu Mar 20, 2025 3:50 am    Post subject: Reply with quote

You can try to modify the systemd-networkd service and add a sleep command.
Code:
 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:
 ### 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:
Code:
ExecStartPre=/bin/sleep 05

or:
Code:
ExecStartPre=/bin/sleep 10


Once the changes are made you may need to run:
Code:
systemctl daemon-reload

to reload the systemd manager configuration.

Also see:
https://github.com/systemd/systemd/issues/7293
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 213
Location: Dallas, TX

PostPosted: Thu Mar 20, 2025 3:58 pm    Post subject: Reply with quote

rab0171610 wrote:
You can try to modify the systemd-networkd service and add a sleep command.
Code:
 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:
 ### 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:
Code:
ExecStartPre=/bin/sleep 05

or:
Code:
ExecStartPre=/bin/sleep 10


Once the changes are made you may need to run:
Code:
systemctl daemon-reload

to reload the systemd manager configuration.

Also see:
https://github.com/systemd/systemd/issues/7293



Close..... It actually required two lines. You need a
Code:
[Service]
tag above the ExecStartPre. Once I added that, it was good to go. I appreciate the assistance. Marking Solved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum