Network problem pi4

Hi,

I’m having a problem of my own making with a Pi 4 and its eth0 network interface.

I’m using the latest version of dietpi OS, which runs a reverse proxy with nginx.

The reverse proxy provides 4 other Pi devices with DynDNS and certificates.

Everything was working great until I had the brilliant idea to replace the Pi 3 with a Pi 4.

The reason was that the Pi 3’s network connection was sometimes unstable and was limited to 100 Mbit.

No sooner said than done—I swapped the Pi 3 for the Pi 4, and it worked fine.

But now I wanted to run the network at 1000Mbit.

I should mention that I had apparently set the eth0 network interface on the Pi 3 to a fixed 100Mbit—not using dietpi-config, but somehow else.

Unfortunately, I no longer remember how or where.

Back to the big problem:

Since I then forced the network to 1000Mbit using dietpi-config, it’s now essentially dead.

It does start up, but then it freezes, so I can no longer access the Pi 4 via SSH.

For now, I’m making do by mounting the USB SSD on another Pi to hopefully find the “right” setting so the network will work again—at least for the time being—so I can continue troubleshooting and get everything back on track.

Why I’m asking so urgently here:

I set up the whole system (reverse proxy / Nginx / DynDNS / Certbot) with the help of AI, which worked great on the Pi 3.

It took a lot of time and effort, which is why I’m so mad at myself—no backup.

I know, no backup—no pity.

But maybe someone here has a few good tips on where `dietpi-config - Network Options: Adapters` stores its configuration!

I’d really appreciate a little help!

edit:

I’ve already tried a lot of things.

For example, I created an rc.local file because the AI suggested that this would override my faulty configuration.

Of course, that didn’t work!

Then I also edited the /etc/network/interfaces file and disabled everything related to eth0.

That didn’t work either!

Oh, and I’m using static IP addresses.

But the main problem right now is probably the incorrect 1000 Mbit setting—that is, forcing the connection to 1000 Mbit.

There must be a setting somewhere that’s still set to 100 Mbit, but I just can’t find it.

Check /etc/network/interfaces.d, /var/lib/dietpi/postboot.d, /etc/systemd/system whether you find a config, script, or service there, which enforces the 100 Mbit. Also try

grep -r ethtool /etc

(adjust the path to the mountpoint in case) to find anything which calls ethtool. There are some expected calls in /etc/network/if-*.d up/down hooks, but those are only active when setting respective directives in /etc/network/interfaces or /etc/network/interfaces.d. E.g. link-speed is supported that way to set the link speed once the interface is configured (instead of unconditionally at boot).

Wow, that approach worked.

I should mention that I first edited the dietpi.txt file to set this.

AUTO_SETUP_NET_ETH_FORCE_SPEED=100

So the network was working again for the time being, though at 1000 Mbit and with Autoneg OFF, which is a bit strange.

But the key clue came from your command:

grep -r ethtool /etc

This resulted in the following output:

root@pi-reverse-proxy:~# grep -r ethtool /etc
/etc/network/if-up.d/ethtool:ETHTOOL=/usr/sbin/ethtool
/etc/network/if-pre-up.d/ethtool:ETHTOOL=/usr/sbin/ethtool
/etc/systemd/system/ethtool_force_speed.service:Description=Enforce 1000 Mbit on eth0 via ethtool (DietPi)
/etc/systemd/system/ethtool_force_speed.service:ExecStart=/usr/sbin/ethtool -s eth0 speed 1000 duplex full autoneg off

I was wondering why it was set to OFF.

So I edited this setting and set “autoneg” to ON.

After a reboot, everything is working great now, and I’m very grateful to you for your absolutely professional help!

root@pi-reverse-proxy:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP    MII ]
Supported link modes:   10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes:  1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes:  10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Auto-negotiation: on
master-slave cfg: preferred slave
master-slave status: slave
Port: Twisted Pair
PHYAD: 1
Transceiver: external
MDI-X: Unknown
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes

Is this a workaround, or did I mess something up before? Either way, the main thing is that it’s fully functional again.

Is there anything else I should keep in mind after switching from the Pi 3 to the Pi 4?

Oh, by the way, the value in dietpi.txt is still 100, should I change it to 0?

This value has no effect, because its a AUTO_SETUP value applied on first boot of DietPi only, ONCE!

Ah, ethtool_force_speed.service is in fact the DietPi implementation for this, when using dietpi.txt as well as when using dietpi-config.

You do not need to change AUTO_SETUP_NET_ETH_FORCE_SPEED anymore. This is only effective for first boot, to have ethtool_force_speed.service with the respective speed created.

The off is related to autoneg. Without this, speed and duplex could not be (persistently) set, since those are otherwise a matter of auto-negotiation between both NICs. So it is necessary to set autoneg off, to be able to (and then also need to) set speed and dupliex values.

The service is not needed if you use auto-negotiation, which is also recommended as long as the board does have a 1 Gbit Ethernet NIC but issues actually running at this speed. Hence, you can unset it in dietpi-config, selecting 0 : Auto-negotiation, or by manually disabling and removing the service:

sudo systemctl disable --now ethtool_force_speed
sudo rm /etc/systemd/system/ethtool_force_speed.service

Thank you both very much!

But I’ll make a backup tomorrow! :wink: