DietPi doesn't reconnect after router reboot

I’m using a Beelink GK35 and have it connected via ethernet cable to a Fios Wireless Extender (connected over MoCa). I am finding no problems whatsoever, other than when I have to reboot my Wireless Extender. After the Extender reconnects, the DietPi doesn’t reconnect to the internet. I have to manually power it on and off and then things are fine.

Is this a simple fix?

And the Pi is connected via Wifi?

No, via ethernet.

More questions:
the Pi is connected directly to the beelink?
Which device handles the DHCP?
Does the Pi or the wireless extender have static IPs?

No, not using a Pi… have installed DietPi on the Beelink and have a ethernet cable going directly from extender to Beelink. I have a static IP set up on my router for the Beelink.

Ok I have no idea why the connection can’t be restored after rebooting the extender,
but instead of rebooting you can disable and enable eth0, to establish a new connection.

When you SSH into the Beelink, you have to do this in one command, otherwise you loose your connection to the beelink after the first command and your are unable to execute the second one.

ifdown eth0 && ifup eth0
(or with sudo before the if commands, if you’re logged in with non-root)

So not sure I’m following…

If I reboot the router, the Beelink loses connection. At that pt I can’t SSH into the Beelink and have to resort to manually powering on and off.

Sure, my bad :roll_eyes:

Then you could run a script with cron every x minutes to check the internet connection and restart the interface, if the connection get’s lost.

if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then
  :
else
  ifdown eth0 && ifup eth0
fi

But in first place I hope somebody else have an idea why the connections gets lost after restarting the router.

this is a behaviour we have seen in some rare cases where a router was rebooted leaving the Pi without connection afterwards. We never found a reason, now was it possible to replicate. Usually people created such a script checking for network connection. There should be a couple of example on the forum. Btw: it is not needed to ping Google DNS server. It should be enough to ping the default gateway. :wink:

Yeah, I’ve read posts online that sound VERY similar to what I’m experiencing. Seems to happen every time the router or wireless extender are rebooted.

Because I’m a lamen, what should this script look like?

At least one user was using watchdog to reboot if network is not reachable. https://defgw.wordpress.com/2017/10/24/watchdog-reboot-raspberry-pi-if-network-is-down/

Alright, to put some kind of wrap to this… I followed that guide, installed Watchdog and tweaked the file and my Beelink seems to have rebooted as intended after I rebooted my router. Ethernet came back after that.

ok good. Hope this helps on your setup.