3

Please help me out with debugging, why my RPI (Raspbian) loses internet connection.

The scenario is this:
1. I start the PI, the ethernet is working.
2. I start one php script, that posts something to remote server with cUrl.
3. The ethernet connection stops after hours.

I need to restart the network with sudo /etc/init.d/networking start and sudo ifup eth0

Content of the /etc/network/interfaces file:

pi@raspberrypi ~ $ cat /etc/network/interfaces
auto lo

iface lo inet loopback

iface eth0 inet static
address 192.168.2.22
netmask 255.255.255.0
gateway 192.168.2.1

How can I find, what causes the problem?

update: the output of ifconfig eth0 after loosing connection:

eth0      Link encap:Ethernet  HWaddr b8:27:eb:05:0e:a7
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:156 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10044 (9.8 KiB)  TX bytes:0 (0.0 B)
nrob
  • 139
  • 1
  • 1
  • 4
  • Add auto eth0 and you won't need ifup eth0. Please post the output of ifconfig eth0 when the connection is lost. – M Noit Jul 10 '14 at 05:22
  • Actually the OP hasn't presented any evidence that the connection is lost. Even a basic ping between devices would be useful. – joan Jul 10 '14 at 08:17
  • Ok, I'll post that output next time the connection lost. Thanks for the auto eth0. – nrob Jul 10 '14 at 11:54
  • How has it worked for the last week? – Bex Jul 16 '14 at 12:17
  • It has worked for 6 days and then lost the connection. Thence it lose the connection daily once. :( – nrob Jul 16 '14 at 12:32
  • It still loses the connection, I dont have any idea to debug it. – nrob Jul 18 '14 at 19:54
  • What does ping output when connection is lost? – David Sykes Aug 05 '14 at 03:39
  • ping output is: unknown host. – nrob Aug 07 '14 at 02:52
  • @heal it is ok that it looses the connection as long as you tell it to automatically reconnect with auto eth0 – thekiwi5000 Feb 16 '15 at 09:40
  • 1
    I know I'm a bit late, but just to add my "me too" in 2017. Raspberry Pi B+ here. Never had this problem before with wheezy, but yesterday I upgraded to jezzie and begin having such problems. I've added the auto eth0 as suggested by thekiwi5000 but I guess that won't prevent from connections to be broken if it's drop while doing something (for example, transferring a file via SMB). – Fran Marzoa Sep 14 '17 at 10:27
  • I have started to have this problem with one of my Raspberry Pis. Occasionally, my router crashes and I when I reboot the router, this one RPi is never reachable again afterwards until it can be rebooted (which is irritating, as it is headless). I have several other machines whose network connections automatically return as soon as the router is available again. – DobbyTheElf Oct 15 '23 at 09:32

1 Answers1

2

I had this same problem with several Model B's running Wheezy. Its only responsibility was to run WeeWx weather station software, so it was not doing all that much. Experiencing the same failure on multiple Pi's indicates either a poor IC design, or a driver issue. What I found was that the OS thought the LAN was up and running, but pings from other systems returned unreachable.

I decided to migrate to a B+ with a fresh install. It has a different USB/LAN interface IC, and it has been running uninterrupted since then (about 4 years), only rebooting with power failures, which are very seldom, especially now that it has battery backup. I have also upgraded to Jessie, and may upgrade again in the near future.

Tom
  • 39
  • 5