networkd static IP lost after cable reconnection

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

networkd static IP lost after cable reconnection

960 Views
razriel
Contributor II

I am using yocto distro with imx8 from NXP.
network manager is systemd-networkd.
The interface used is based on  Microchip SMSC9512/9514 Fast Ethernet Adapter(USB to Ethernet chip)
I have added a file named 25-wired.network to /etc/systemd/network folder.
the file contains the following lines:
[Match]
Name=eth1
KernelCommandLine=!nfsroot

[Network]
Address=192.168.50.99/24
Gateway=192.168.50.255
DNS=8.8.8.8

[DHCPv4]
UseHostname=false

When machine boots eth1 interface is configured with the static IP as expected.
when I disconnect and connect the network calble the IP of the eth1 is lost although I can see link up in dmesg.
is there any value I should add to the *.network file for it to set the IP ? or any other way to solve this issue ?

BR,

Roy

Labels (1)
0 Kudos
Reply
3 Replies

933 Views
Harvey021
NXP TechSupport
NXP TechSupport

Hi @razriel 

I do a test for the same configuration on  8QM MEK. a difference about Name=eth0, which defaults with eth0. There is no such issue of "network static IP lost after cable reconnection". 

Best regards

Harvey

0 Kudos
Reply

956 Views
Guth55434
Contributor I

use dhcpcd like below can solve this problem

dhcpcd -S ip_address=10.0.0.135 -S rounters=10.0.0.1 -S subnet_mask=255.255.255 eth0

 

JCPenney Kiosk Associates

0 Kudos
Reply

951 Views
razriel
Contributor II

Thanks,

in what conf file I am supposed to set it ?

 

 

0 Kudos
Reply