Every day my Raspberry Pi 4 4GB loses ethernet (wired) network connectivity (I don't use WiFi on the device). The device is otherwise still functional, but no matter whether I down/up the interface, restart networking with service networking restart
, un/replug the network cable, or even shutdown -r now
the device, the network does not return. The device must be fully halted shutdown -hP now
, power pulled, and power returned for the network to also return.
Since I started taking notice of exactly when it went down (I have remote endpoint monitoring polling every 5 minutes), I've finally determined it is exactly 24h after the last power up that the network dies.
I can't find anything in /var/log/syslog
or /var/log/messages
, beyond software components failing to connect to things. avahi-daemon
even mentions releasing IP addresses a while after it is clear the network has already gone, but no event to explain why.
Pi's uses:
- Docker for these images: Plex, Netdata, Pi Hole, Tautulli, Traefik, among others
autossh
to keep a tunnel to a remote server up
I can't figure it out. I don't know where else to look. Short of attempting to boot this same system from another of the exact same model of Pi I have, I don't know what other investigation to perform.
EDIT 20201231: Using a combination of:
tcpdump
on the DHCP server/router- changing the DHCP lifetime in DHCP server to something short to ease diagnosis (5 minutes/300 seconds)
- tracking the IP address lifetime on the Raspberry Pi (
watch 'sudo ip addr | grep -A 3 eth0:'
and watching 'preferred_lft') sudo dcpdump -i /dev/eth0
...I've been able to see that the device does not appear to send any further DHCP packets over eth0/into the switch/to the router after boot. The preferred_lft gets to 0sec and the address is deprecated, then once valid_lft ticks through, the IPv4 address is dropped.
In a moment of weird thought, I wondered what would happen if I disabled the docker daemon using sudo systemctl disable docker
, and after a reboot, I could see that the address would never get close to expiring (as is supposed to happen) and the DHCP lease would be renewed as intended. So clearly there is something about the Docker setup that is causing DHCP to go awry, hence requiring a reboot.
I'll have to play around with my Docker stacks (using docker-compose.yml files and running about 5-6 stacks) to make sure nothing untoward is in there. It may even be that a certain container has an incompatibility with the Raspberry Pi.
service networking restart
won't help as it isn't normally used. What doesip a && ip r
show