Raspberry pi loses network on restart
I'm trying to figure out this problem.
Whenever the pi (a pi 4) restarts, it loses network connectivity. The way that I have found around this is to log in manually and do sudo dhclient -r, which releases the lease. I then do sudo dhclient, which obtains a fresh IP address. Sometimes it's the same IP, sometimes its different.
So, what did I break and how do I fix it?
Edit for the solution:
I didn't break anything, this is actually a known bug in the linux system. Gist is that if you have too many network interfaces, dhcpcd crashes.
Adding denyinterfaces veth* to /etc/dhcpcd.conf works, as does shutting down your containers prior to restart. I chose the former.
I finally caught it because I was able to track down the issue to dhcpcd.service, which had a single line in there about 'route socket overflowed'.
Posted Apr 8, 2022, 12:28 PM UTC · edited
Check the logs (
grep -i dhcp /var/log/syslog | more) or get a screen or serial console hooked up and watch what it's doing during bootup.I appreciate that! It looks like what is happening is that the pi is querying for an IP using the wrong netmask (255.255.255.255 instead of 255.255.255.0).
What gives you that impression? 255.255.255.255 is not necessarily a netmask, it is also the broadcast address.
It's running DHCPDISCOVER on 255.255.255.255 and then having No DHCPOFFERS received.
When I look at the actual connection, the netmask is 255.255.255.0
That's what I suspected, and is perfectly normal. That isn't an netmask, it's a network address. Specifically it's the broadcast address. Every machine on the network receives traffic sent to it. This is how it searches for the DHCP server, which it can't find.
Netmasks are unrelated.