network problem Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
sschubert

network problem

Post by sschubert »

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.
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: network problem

Post by Fourdee »

sschubert wrote: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.
Hi,

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.

Code: Select all

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.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
sschubert

Re: network problem

Post by sschubert »

I've tried your steps but I still don't know what the problem is. Maybe you can see something in the screen shot.
Attachments
PiScreenshot.jpg
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: network problem

Post by Fourdee »

sschubert wrote:I've tried your steps but I still don't know what the problem is. Maybe you can see something in the screen shot.
Thanks.

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

Code: Select all

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?
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
sschubert

Re: network problem

Post by sschubert »

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

Code: Select all
ifconfig -a
ifdown eth0
killall -w dhclient
ifup eth0
ifconfig -a

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).
sschubert wrote: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?
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.
Attachments
3.JPG
2.JPG
1.JPG
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: network problem

Post by Fourdee »

Hi sschubert,

Thanks for the results.

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

Code: Select all

/DietPi/dietpi/func/dietpi-set_wifi_bt wifi 0
reboot
send_packet: Network is unreachable
Might be a gateway/subnet issue, can you take a picture of the following please:

Code: Select all

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 ?
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
sschubert

Re: network problem

Post by sschubert »

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

Code: Select all
/DietPi/dietpi/func/dietpi-set_wifi_bt wifi 0
reboot
I can't find this script on my pi. There are others like dietpi-set_wificountrycode but not that one.
Fourdee wrote: send_packet: Network is unreachable


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

Code: Select all
cat /etc/network/interfaces

. Please hide any WiFi keys (if set).
The content of the file is:

Code: Select all

#/etc/network/interfaces
#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
address 192.168.178.30
netmask 255.255.255.0
gateway 192.168.178.1
#dns-nameservers 192.168.178.1

# Wifi
#allow-hotplug wlan0
iface wlan0 inet dhcp
metric 1
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
wireless-essid XXX
wireless-key XXX
wireless-mode Managed
wireless-power off
wpa-ssid XXX
wpa-psk XXX
#dns-nameservers 8.8.8.8 8.8.4.4
The settings look good to me. But where is the IPv6 stuff?
Fourdee wrote:- Which PSU are you using on this device (eg: Samsung 2a)?
I have the Raspi3 PSU.
sschubert wrote:- Which SD card (eg: Sandisk Ultra 8gb)?
I have a Sandisk Ultra 32GB.
sschubert wrote:- Is this a RPi3 ?
Yes this one is a Rapi3 but I also have a Rapi 2 and it has the same problems.
Post Reply