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.
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.
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.