Ickam
Posts: 16
Joined: Sat May 13, 2017 10:16 am

Ethernet-connected 3b doesn't always come online

Sun Dec 15, 2019 8:37 pm

I have a raspberry pi 3b that I use for a variety of purposes. It is connected through ethernet. Recently I noticed that it doesn't always come back onto my local network, i.e. it doesn't show up on my router's list of connected devices, nor does it accept ssh / vnc connections after a reboot. At first I thought that it was due to a failing microSD card, but I reimagined my recent backup on a brand new card and the problem persist. It takes anything between two and five reboots for it to come back.
Is there anything that I can do to ensure it reconnects after every reboot?

epoch1970
Posts: 5911
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Ethernet-connected 3b doesn't always come online

Sun Dec 15, 2019 8:45 pm

Is it configured via DHCP?
Do you use the file /etc/network/interfaces? (don't)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Ickam
Posts: 16
Joined: Sat May 13, 2017 10:16 am

Re: Ethernet-connected 3b doesn't always come online

Sun Dec 15, 2019 8:57 pm

epoch1970 wrote:
Sun Dec 15, 2019 8:45 pm
Is it configured via DHCP?
Do you use the file /etc/network/interfaces? (don't)
My ip is static.
I have a file at /etc/network/interfaces. Are you saying to delete it?

epoch1970
Posts: 5911
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Ethernet-connected 3b doesn't always come online

Sun Dec 15, 2019 9:46 pm

If your OS is somewhat recent, then ifupdown is not to be used. When ifupdown is activated by editing the legacy interfaces file, the other means of configuring networking disengage or clash with it.
In the case of Raspbian, dhcpcd gives up configuring interfaces that are defined in that file. So this could explain that.

ifupdown was a cool Debian addition to linux over 15 years ago. It started struggling as soon as udev appeared (not yesterday...), and by now its design is completely at odds with the way linux, desktop environments and other modern daemons work.
It is still somewhat valid in embedded and server scenarios, but that's it.

In the official documentation and in /etc/dhcpcd.conf itself you will see examples of static IP config if you really need that. Since you have access to your router I would recommend using fixed IP DHCP reservation instead of configuring a static IP in the machine.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Ickam
Posts: 16
Joined: Sat May 13, 2017 10:16 am

Re: Ethernet-connected 3b doesn't always come online

Sun Dec 15, 2019 9:57 pm

I already have the reservation.
Also, my Raspbian is Buster, but updated all the way from Jessie. Please explain how am I supposed to disable /etc/network/interfaces.

epoch1970
Posts: 5911
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Ethernet-connected 3b doesn't always come online

Sun Dec 15, 2019 10:03 pm

Comment every single interface block defined in it (and in interfaces.d/* snippets)
Don't even keep lo in there.

Then edit dhcpcd.conf, near the bottom of the file you should see static config examples you can copy-paste, uncomment and adapt.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Ickam
Posts: 16
Joined: Sat May 13, 2017 10:16 am

Re: Ethernet-connected 3b doesn't always come online

Sun Jan 12, 2020 10:29 am

epoch1970 wrote:
Sun Dec 15, 2019 10:03 pm
Comment every single interface block defined in it (and in interfaces.d/* snippets)
Don't even keep lo in there.

Then edit dhcpcd.conf, near the bottom of the file you should see static config examples you can copy-paste, uncomment and adapt.
The problem still persists. I commented every line in the interfaces file, the interfaces.d folder is empty and my dhcpcd was already configured for static config, as I use pihole

pcmanbob
Posts: 10487
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Ethernet-connected 3b doesn't always come online

Sun Jan 12, 2020 6:42 pm

Ickam wrote:
Sun Dec 15, 2019 9:57 pm

Also, my Raspbian is Buster, but updated all the way from Jessie.
So have you upgraded each time by just changing the sources list and doing update/upgrade ?

if so this could well be the cause of your problems which is why its not recommended you do this.

It is recommended you start over with a fresh install of raspbian each time there is a new version .
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Return to “Troubleshooting”