network problem

If I reboot DietPi the ethernet connection does not work all of the time. When I go to the network settings it says that ethernet is disconnected. I can only solve this by unplugging and replugging the ethernet cable but this also does not work all of the time. I have 2 Pis with a similar setup and they both have this problem. All my other devices work fine. I have installed an Apache server with Owncloud, fail2ban and the OpenSSH server. I have no idea what to do now. Any help would appreciated.


If all devices are having the same issue, it could be an issue with your router. It sounds like its failing to provide DCHP leases.

Try manually bringing up the adapter:
This will drop connections, so best to do it at the device.

ifdown eth0
killall -w dhclient
systemctl restart networking
ifup eth0

Now check the screen for any errors or “DHCP lease failed”. Take a picture if you can.

I’ve tried your steps but I still don’t know what the problem is. Maybe you can see something in the screen shot.


Need some more info. After a fresh reboot, can you take pictures of the following:

ifconfig -a
ifdown eth0
killall -w dhclient
ifup eth0
ifconfig -a

Also, some questions:

  • have you tried using a different network cable?
  • Is this device connected directly to your router via a network cable, or a switch hub?

Please see the attached screenshots. This time the ethernet connection was repaired after executing your commands. But it does not seem to work all of the time. You can see the configuration before in 1.jpg and after in 3.jpg (the attachements seem to have the wrong order in the forum).

Yes I have tried a different network cable and the pi is directly connected to the router. My router and internet provider already have full IPv6 support in addition to IPv4 in case this does matter. This pi has wifi but it is disabled in the DietPi configuration.

Hi sschubert,

Thanks for the results.

It looks like the WiFi connection is still active, lets try and disable it again:

/DietPi/dietpi/func/dietpi-set_wifi_bt wifi 0

send_packet: Network is unreachable

Might be a gateway/subnet issue, can you take a picture of the following please:

cat /etc/network/interfaces

. Please hide any WiFi keys (if set).

Some more questions:

  • Which PSU are you using on this device (eg: Samsung 2a)?
  • Which SD card (eg: Sandisk Ultra 8gb)?
  • Is this a RPi3 ?

I can’t find this script on my pi. There are others like dietpi-set_wificountrycode but not that one.

The content of the file is:

#Please use DietPi-Config to modify network settings.

# Local
auto lo
iface lo inet loopback

# Ethernet
allow-hotplug eth0
iface eth0 inet dhcp
metric 0

# Wifi
#allow-hotplug wlan0
iface wlan0 inet dhcp
metric 1
wireless-essid XXX
wireless-key XXX
wireless-mode Managed
wireless-power off
wpa-ssid XXX
wpa-psk XXX

The settings look good to me. But where is the IPv6 stuff?

I have the Raspi3 PSU.

I have a Sandisk Ultra 32GB.

Yes this one is a Rapi3 but I also have a Rapi 2 and it has the same problems.