Ethernet networking not working randomly

Required Information

  • DietPi version | 8.23
  • Distro version | bookworm
  • Kernel version | 5.10.160-legacy-rk35xx
  • Architecture | arm64
  • SBC model | Orange Pi 5 Plus (aarch64)
  • SD card used | N/A, NVME drive

Additional Information (if applicable)

Sometimes happens on a new install. It seems completely random when this happens.

Steps to reproduce

I really have no clue. On some boots my Ethernet connection will work, on others it won’t. I have tried on completely separate networks, with DHCP and static IPs. Sometimes dhclient fails and says no offers received. When my networking doesn’t work, ip route will show linkdown.

Expected behaviour

I should be able to access the network.

Actual behaviour

I can’t access anything on the network.

Extra details

I have been at this for hours. I have had this issue on my “real” home network, where both DHCP and static IP attemps will sometimes work and sometimes not, and I am also having this issue on a network that consists of the orangepi, a switch, and another PC connected to the switch, where the PC sometimes can ping and SSH into the opi, and sometimes can’t. I can’t see anything wrong in journalctl, or dmesg. I know the hardware is functional because it works flawlessly on ubuntu, it’s just dietpi. The only thing I can see is that when it’s not working, ip route prints linkdown.

Linkdown can mean faulty cable, switch, or ethernet port.

Can you elaborate?

Before installing dietpi I installed Ubuntu, and the networking worked just fine. It’s just when I install dietpi things go bad.

I’m pretty sure that both OSes will use the same module for the ethernet card, but if you have a spare SD card you can try to boot the Ubuntu and run an lsmod to compare it with the same command in Dietpi. Other than that a hardware failure can occur anytime, so I still would not rule out a faulty cable or some other problem.

Do you have local access if network connection is failing? Could you check following as soon as the issue occurs

journalctl -u ifup@eth0.service

Sorry for the late reply, I put this aside to study for midterms.

I discovered something I believe to be related to the issue I’m having. It seems that the MAC addresses of eth0 and eth1 (this board has two LAN ports) are swapping (checked ip addr show) when I am having the connection issue.

I am only using one LAN port, and the OS always says the network interface being used is eth0. I don’t get what triggers the swap (it might happen on the boot after switching from DHCP to static but I have yet to confirm), but this tells me when I am having issues that eth0 is now interfaced to the other (unplugged) LAN port, and eth1 has taken the plugged in LAN port from eth0. Traffic is not sent through eth1, but through eth0, which now goes nowhere.

Maybe when DHCP is used, eth0 will attach to either LAN port based on which one has a cable, but with static it will attach to a pre-determined LAN port?

After some more testing, I’m not sure exactly what the behaviour pattern is, but eth0 seems to randomly pick a LAN port on boot when using a static ip, regardless of which one is plugged in.

Is there a way to specify one myself?

could this be similar ??? no IP address when first install is run · Issue #6592 · MichaIng/DietPi · GitHub

I’m pretty sure this is exactly the same issue.

Any ideas on a workaround in the meantime? I only need one of the LAN ports so I don’t mind disabling one completely in the OS.

Best is to connect to the GitHub issue to ensure all information at one place.

Are you asking me to make a new github issue referencing the one you linked? Sorry I’m not sure I understand what you are saying.

No need to create a new issue. Simply post into the existing one.