M-Reimer
Posts: 12
Joined: Fri Aug 30, 2013 8:24 pm

Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 11:23 am

Hello,

I have a problem with my Raspberry Pi 4.
Maybe this already has been addressed in another forum. If so, please post the link to the report.

Whenever I boot my eth0 does not get a valid IPv4 IP.
I have to unplug and replug the network plug which then triggers a working DHCP request.

Is this known? Is there a workaround?

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

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 12:45 pm

No you pi should get a valid IP from the router DHCP on boot.

The first thing I would try is power down the pi reboot the router and then once the router has finished its boot, power you pi and see if it gets a valid IP
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

M-Reimer
Posts: 12
Joined: Fri Aug 30, 2013 8:24 pm

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 1:04 pm

I have tried that. Still the same problem.
I get "some" IP but the one I get is completely wrong for my network.

Here some logs:

Code: Select all

Jun 29 12:35:53 raspberrypi dhcpcd[350]: eth0: waiting for carrier
Jun 29 12:35:53 raspberrypi dhcpcd[350]: wlan0: waiting for carrier
Jun 29 12:35:53 raspberrypi dhcpcd[350]: wlan0: carrier acquired
Jun 29 12:35:53 raspberrypi kernel: bcmgenet fd580000.genet: configuring instance for external RGMII (no delay)
Jun 29 12:35:53 raspberrypi kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Jun 29 12:35:53 raspberrypi dhcpcd[350]: wlan0: carrier lost
Jun 29 12:35:54 raspberrypi raspi-config[342]: Checking if shift key is held down: No. Switching to ondemand scaling governor.
Jun 29 12:35:54 raspberrypi systemd[1]: Started LSB: Switch to ondemand cpu governor (unless shift key is pressed).
Jun 29 12:35:54 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Down
Jun 29 12:35:57 raspberrypi systemd[1]: systemd-rfkill.service: Succeeded.
Jun 29 12:35:58 raspberrypi dhcpcd[350]: eth0: carrier acquired
Jun 29 12:35:58 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Jun 29 12:35:58 raspberrypi kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Jun 29 12:35:59 raspberrypi dhcpcd[350]: eth0: soliciting a DHCP lease


Jun 29 12:36:04 raspberrypi dhcpcd[350]: eth0: probing for an IPv4LL address
Jun 29 12:36:04 raspberrypi systemd[1]: systemd-rfkill.service: Succeeded.
Jun 29 12:36:09 raspberrypi dhcpcd[350]: eth0: using IPv4LL address 169.254.12.139
Jun 29 12:36:09 raspberrypi dhcpcd[350]: eth0: adding route to 169.254.0.0/16
Jun 29 12:36:09 raspberrypi dhcpcd[350]: eth0: adding default route
Jun 29 12:36:09 raspberrypi dhcpcd[350]: forked to background, child pid 465
Jun 29 12:36:09 raspberrypi systemd[1]: Started dhcpcd on all interfaces.
Then I removed the network cable and plugged it in again:

Code: Select all

Jun 29 12:40:26 raspberrypi dhcpcd[465]: eth0: carrier lost
Jun 29 12:40:26 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Down
Jun 29 12:40:26 raspberrypi dhcpcd[465]: eth0: deleting route to 169.254.0.0/16
Jun 29 12:40:26 raspberrypi dhcpcd[465]: eth0: deleting default route
Jun 29 12:40:29 raspberrypi dhcpcd[465]: eth0: carrier acquired
Jun 29 12:40:29 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Jun 29 12:40:30 raspberrypi dhcpcd[465]: eth0: soliciting a DHCP lease
Jun 29 12:40:31 raspberrypi dhcpcd[465]: eth0: offered 192.168.178.30 from 192.168.178.1
Jun 29 12:40:31 raspberrypi dhcpcd[465]: eth0: probing address 192.168.178.30/24
Jun 29 12:40:35 raspberrypi dhcpcd[465]: eth0: leased 192.168.178.30 for 864000 seconds
Jun 29 12:40:35 raspberrypi dhcpcd[465]: eth0: adding route to 192.168.178.0/24
Jun 29 12:40:35 raspberrypi dhcpcd[465]: eth0: adding default route via 192.168.178.1
Jun 29 14:00:55 raspberrypi systemd-timesyncd[299]: Synchronized to time server for the first time 217.79.179.106:123 (0.debian.pool.ntp.org).
I have to do this every time... At first I get this "invalid" IP 169.254.12.139. Then I have to unplug and replug the network cable to get a valid IP.

M-Reimer
Posts: 12
Joined: Fri Aug 30, 2013 8:24 pm

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 1:16 pm

I've disabled this "IPv4LL" now.

Result in journal:

Code: Select all

Jun 29 14:08:14 raspberrypi dhcpcd[359]: eth0: waiting for carrier
Jun 29 14:08:14 raspberrypi dhcpcd[359]: wlan0: waiting for carrier
Jun 29 14:08:14 raspberrypi dhcpcd[359]: wlan0: carrier acquired
Jun 29 14:08:14 raspberrypi kernel: bcmgenet fd580000.genet: configuring instance for external RGMII (no delay)
Jun 29 14:08:14 raspberrypi kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Jun 29 14:08:14 raspberrypi dhcpcd[359]: wlan0: carrier lost
Jun 29 14:08:14 raspberrypi raspi-config[342]: Checking if shift key is held down: No. Switching to ondemand scaling governor.
Jun 29 14:08:14 raspberrypi systemd[1]: Started LSB: Switch to ondemand cpu governor (unless shift key is pressed).
Jun 29 14:08:15 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Down
Jun 29 14:08:17 raspberrypi systemd[1]: systemd-rfkill.service: Succeeded.
Jun 29 14:08:19 raspberrypi dhcpcd[359]: eth0: carrier acquired
Jun 29 14:08:19 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Jun 29 14:08:19 raspberrypi kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Jun 29 14:08:19 raspberrypi dhcpcd[359]: eth0: rebinding lease of 192.168.178.30

Jun 29 14:08:24 raspberrypi dhcpcd[359]: eth0: DHCP lease expired
Jun 29 14:08:24 raspberrypi dhcpcd[359]: eth0: DHCP lease expired
Jun 29 14:08:24 raspberrypi dhcpcd[359]: eth0: soliciting a DHCP lease
Jun 29 14:08:25 raspberrypi systemd[1]: systemd-rfkill.service: Succeeded.
Jun 29 14:08:42 raspberrypi systemd[1]: systemd-fsckd.service: Succeeded.
Jun 29 14:08:43 raspberrypi dhcpcd[359]: timed out
Jun 29 14:08:43 raspberrypi dhcpcd[359]: timed out
Jun 29 14:08:43 raspberrypi dhcpcd[359]: forked to background, child pid 460
Then I tried to "systemctl restart dhcpcd":

Code: Select all

Jun 29 14:09:44 raspberrypi systemd[1]: Stopping dhcpcd on all interfaces...
Jun 29 14:09:44 raspberrypi dhcpcd[525]: sending signal TERM to pid 460
Jun 29 14:09:44 raspberrypi dhcpcd[525]: waiting for pid 460 to exit
Jun 29 14:09:44 raspberrypi dhcpcd[525]: sending signal TERM to pid 460
Jun 29 14:09:44 raspberrypi dhcpcd[525]: waiting for pid 460 to exit
Jun 29 14:09:44 raspberrypi dhcpcd[460]: received SIGTERM, stopping
Jun 29 14:09:44 raspberrypi dhcpcd[460]: wlan0: removing interface
Jun 29 14:09:44 raspberrypi dhcpcd[460]: eth0: removing interface
Jun 29 14:09:44 raspberrypi dhcpcd[460]: dhcpcd exited
Jun 29 14:09:44 raspberrypi systemd[1]: dhcpcd.service: Succeeded.
Jun 29 14:09:44 raspberrypi systemd[1]: Stopped dhcpcd on all interfaces.
Jun 29 14:09:44 raspberrypi systemd[1]: Starting dhcpcd on all interfaces...
Jun 29 14:09:45 raspberrypi dhcpcd[528]: dev: loaded udev
Jun 29 14:09:45 raspberrypi dhcpcd[528]: wlan0: starting wpa_supplicant
Jun 29 14:09:45 raspberrypi dhcpcd-run-hooks[539]: wlan0: starting wpa_supplicant
Jun 29 14:09:45 raspberrypi kernel: IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Jun 29 14:09:45 raspberrypi kernel: brcmfmac: power management disabled
Jun 29 14:09:45 raspberrypi dhcpcd[528]: wlan0: waiting for carrier
Jun 29 14:09:45 raspberrypi dhcpcd[528]: eth0: soliciting a DHCP lease
Jun 29 14:10:15 raspberrypi dhcpcd[528]: timed out
Jun 29 14:10:15 raspberrypi dhcpcd[528]: timed out
Jun 29 14:10:15 raspberrypi dhcpcd[528]: forked to background, child pid 550
Jun 29 14:10:15 raspberrypi systemd[1]: Started dhcpcd on all interfaces.
Unplugging/Replugging the network cable:

Code: Select all

Jun 29 14:12:02 raspberrypi dhcpcd[550]: eth0: carrier lost
Jun 29 14:12:02 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Down
Jun 29 14:12:05 raspberrypi dhcpcd[550]: eth0: carrier acquired
Jun 29 14:12:05 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Jun 29 14:12:06 raspberrypi dhcpcd[550]: eth0: soliciting a DHCP lease
Jun 29 14:12:07 raspberrypi dhcpcd[550]: eth0: offered 192.168.178.30 from 192.168.178.1
Jun 29 14:12:07 raspberrypi dhcpcd[550]: eth0: probing address 192.168.178.30/24
Jun 29 14:12:12 raspberrypi dhcpcd[550]: eth0: leased 192.168.178.30 for 864000 seconds
Jun 29 14:12:12 raspberrypi dhcpcd[550]: eth0: adding route to 192.168.178.0/24
Jun 29 14:12:12 raspberrypi dhcpcd[550]: eth0: adding default route via 192.168.178.1
Jun 29 14:12:25 raspberrypi systemd-timesyncd[304]: Synchronized to time server for the first time 195.50.171.101:123 (0.debian.pool.ntp.org).
I'm giving up now. For some reason the ethernet interface "hangs up" and the only way to restore seems to unplug and replug the ethernet cable... :(

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

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 1:21 pm

OK before you give up 2 things to try, use a different LAN cable between your pi and the router,
if that does not work and you have a spare SD card try downloading raspbian lite ( just because it smaller ) and flash that directly to the SD card and try booting your pi with that.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
rin67630
Posts: 1132
Joined: Fri Mar 04, 2016 10:15 am

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 1:59 pm

You get a self-assigned default formatted IP 169.254.n.m.
The DHCP of your router does not assign you an IP.
Why? Don't know.
Did it work on another Pi?
Have you tried another router?

incognitum
Posts: 842
Joined: Tue Oct 30, 2018 3:34 pm

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 2:25 pm

Does restarting link speed negotiation with "sudo mii-tool -r eth0" also make it work, instead of replugging network cable?

M-Reimer
Posts: 12
Joined: Fri Aug 30, 2013 8:24 pm

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 2:48 pm

pcmanbob wrote:
Sat Jun 29, 2019 1:21 pm
OK before you give up 2 things to try, use a different LAN cable between your pi and the router,
if that does not work and you have a spare SD card try downloading raspbian lite ( just because it smaller ) and flash that directly to the SD card and try booting your pi with that.
I replaced the cable. No change
The SD card already has raspbian lite on it.

M-Reimer
Posts: 12
Joined: Fri Aug 30, 2013 8:24 pm

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 2:49 pm

rin67630 wrote:
Sat Jun 29, 2019 1:59 pm
You get a self-assigned default formatted IP 169.254.n.m.
The DHCP of your router does not assign you an IP.
Why? Don't know.
Did it work on another Pi?
Have you tried another router?
I only have this router.
It worked for every other Pi I used so far (different versions of "1", "2" and "3").

M-Reimer
Posts: 12
Joined: Fri Aug 30, 2013 8:24 pm

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 2:51 pm

incognitum wrote:
Sat Jun 29, 2019 2:25 pm
Does restarting link speed negotiation with "sudo mii-tool -r eth0" also make it work, instead of replugging network cable?
Yes, it does.

Code: Select all

Jun 29 14:22:28 raspberrypi sudo[506]:       pi : TTY=tty1 ; PWD=/home/pi ; USER=root ; COMMAND=/sbin/mii-tool -r eth0
Jun 29 14:22:28 raspberrypi sudo[506]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Jun 29 14:22:28 raspberrypi sudo[506]: pam_unix(sudo:session): session closed for user root
Jun 29 14:22:29 raspberrypi dhcpcd[459]: eth0: carrier lost
Jun 29 14:22:29 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Down
Jun 29 14:22:33 raspberrypi dhcpcd[459]: eth0: carrier acquired
Jun 29 14:22:33 raspberrypi kernel: bcmgenet fd580000.genet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Jun 29 14:22:34 raspberrypi dhcpcd[459]: eth0: soliciting a DHCP lease
Jun 29 14:22:35 raspberrypi dhcpcd[459]: eth0: offered 192.168.178.30 from 192.168.178.1
Jun 29 14:22:35 raspberrypi dhcpcd[459]: eth0: probing address 192.168.178.30/24
Jun 29 14:22:39 raspberrypi dhcpcd[459]: eth0: leased 192.168.178.30 for 864000 seconds
Jun 29 14:22:39 raspberrypi dhcpcd[459]: eth0: adding route to 192.168.178.0/24
Jun 29 14:22:39 raspberrypi dhcpcd[459]: eth0: adding default route via 192.168.178.1
Jun 29 15:50:41 raspberrypi systemd-timesyncd[300]: Synchronized to time server for the first time 195.201.19.162:123 (2.debian.pool.ntp.org).
Does this help somehow to track down the real issue?

If this helps: I've copied the kernel and kernel-modules to a fresh Arch Linux ARM SD card to make Arch boot on the new Raspberry.
While the problem does not exist with the unmodified Arch SD card on an Raspberry 2, the problem is the same on the Raspberry Pi 4.
So I've transported the issue over to Arch Linux by copying over the kernel. Seems like something special in the kernel or in the kernel modules.

Should I try to get a refund or is there chance for a software fix?

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

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 3:11 pm

I would still try a fresh download of raspbian lite and try flashing to a different SD card, just to eliminate a bad download, bad flash or corrupted SD card.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

M-Reimer
Posts: 12
Joined: Fri Aug 30, 2013 8:24 pm

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 3:26 pm

pcmanbob wrote:
Sat Jun 29, 2019 3:11 pm
I would still try a fresh download of raspbian lite and try flashing to a different SD card, just to eliminate a bad download, bad flash or corrupted SD card.
I'm currently flashing the image again.
But I'm almost 100% sure that this won't change anything. The relevant files (firmware and kernel) were updated via apt-get already and this update didn't change the problem.
The problem also exists on Arch Linux ARM if I copy the Raspbian kernel over to the Arch SD card so I think it is either a kernel bug or something with my hardware is broken.

User avatar
rin67630
Posts: 1132
Joined: Fri Mar 04, 2016 10:15 am

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 4:12 pm

You might have got a flaky RJ45 connector with levels at the specs limit.
Does a WLAN connection succeed?

User avatar
HawaiianPi
Posts: 6828
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 4:17 pm

M-Reimer wrote:
Sat Jun 29, 2019 2:48 pm
I replaced the cable. No change
Try a different Ethernet port on the router.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

nightpi
Posts: 1
Joined: Sat Jun 29, 2019 5:24 pm

Re: Raspberry Pi 4: No IP directly after boot

Sat Jun 29, 2019 5:37 pm

I've the same problem, but it appeared only after upgrading Raspian on my new Raspberry Pi 4 (4GB)

Now, even in my case, to get dhcp address from router I've to unplug and plugin again the cable.

I also noticed that if I connect an ethernet usb adapter and then restart, both eth0 and eth1 (usb adapter)
correctly get ip addresses from router.

I wonder if someone else successfully upgraded raspbian without experiencing this issue.

M-Reimer
Posts: 12
Joined: Fri Aug 30, 2013 8:24 pm

Re: Raspberry Pi 4: No IP directly after boot

Sun Jun 30, 2019 9:52 am

Today I wanted to try to compile a kernel for Arch Linux ARM with proper USB 3.0 support.

So I created a fresh Arch Linux ARM SD card without any modifications, bootet it on an RPi 3 and updated it there to get an up-to-date firmware and kernel.

This combination boots on the RPi 4 but without USB and (as I thought so far) without Network. But to my surprise network worked directly this time. Until I rebooted the Arch Linux ARM system which brought me into the same disfunctional network state again.

So the current Arch Linux ARM kernel has the exactly same bug.
I still don't know if this is a kernel bug (so far I failed to get some useful error message) or a hardware bug.
I've created an Issue here: https://github.com/raspberrypi/linux/issues/3034

Elouin
Posts: 1
Joined: Wed Sep 11, 2019 7:21 am

Re: Raspberry Pi 4: No IP directly after boot

Wed Sep 11, 2019 7:23 am

I got exactly the same Problem on a Raspberry PI 2. Super annoying. Is there any fix for that yet? Iam running raspbian Stretch.

vegz78
Posts: 27
Joined: Sat Jan 20, 2018 9:36 pm
Contact: Website

Re: Raspberry Pi 4: No IP directly after boot

Fri May 15, 2020 3:48 pm

Hi,

I just experienced something very similar when booting my RPi4 running buster, but replugging the ethernet cable wouldn't help, only 'sudo systemctl restart dhcpcd'.

The culprit in my case was a file, for me called wait.conf, that was located under '/etc/systemd/system/dhcpcd.service'.

Once deleted and a quick 'sudo systemctl daemon-reload' I had connection and ip address on my eth0 after the next reboot.


Br,
Vegard
Br,
Vegard
https://github.com/Vegz78

Return to “Raspberry Pi OS”