networkd static IP lost after cable reconnection

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

networkd static IP lost after cable reconnection

958 次查看
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

标签 (1)
0 项奖励
回复
3 回复数

931 次查看
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 项奖励
回复

954 次查看
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 项奖励
回复

949 次查看
razriel
Contributor II

Thanks,

in what conf file I am supposed to set it ?

 

 

0 项奖励
回复