eth0 cant fetch IP
Closed this issue · 4 comments
Without running the command sudo netplan apply
after every startup, the eth0 cant get IP address.
Adding the sudo netplan apply
to /etc/rc.local
didnt fix the issue :/
PS.
Configured wlan0 interface works perfectly.
Temporary solution:
Put in crontab below script to run every minute. As root user of course ;)
#!/bin/bash
IPADDR=`/bin/ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1`
#echo "IPADDR: [$IPADDR]";
if [ "$IPADDR" == "" ]
then
#echo "Running the 'netplan apply' command"
netplan apply
fi
If I check with: journalctl --no-pager -lu systemd-networkd
I can see this:
Nov 16 13:43:47 ubuntu systemd[1]: Starting Network Service...
Nov 16 13:43:47 ubuntu systemd-networkd[1455]: wlan0: Gained IPv6LL
Nov 16 13:43:47 ubuntu systemd-networkd[1455]: Enumeration completed
Nov 16 13:43:47 ubuntu systemd-networkd[1455]: eth0: Could not find udev device: No such device
Nov 16 13:43:47 ubuntu systemd-networkd[1455]: eth0: Failed
Nov 16 13:43:47 ubuntu systemd-networkd[1455]: Could not add new link, ignoring: No such device
Nov 16 13:43:47 ubuntu systemd[1]: Started Network Service.
I think it could be realted to: https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1770082
The problem seems fixed in newer netplan releases, so this should be fixed in a future Ubuntu (armhf) update.
Meanhwile, adding @reboot /usr/sbin/netplan apply
to root crontab (sudo crontab -e
) is working for me. Can you try and confirm if this workaround is ok for you too?