Fixing Pi-hole Dropouts on Zero: Debugging the USB NIC Flapping Issue

For a while, my zero.local Pi-hole / Tailscale box would randomly go offline. DNS queries failed, Tailscale would scream about DERP disconnects, and sometimes the only fix was a reboot. This was on a Raspberry Pi Zero 2 W with a Waveshare ETH/USB Hub Hat using a Realtek R8152 NIC.

The real culprit turned out to be the NIC flapping its link — dropping carrier and renegotiating constantly. Here’s the final clean fix that made it stable.

If you just want the commands, check out the Quick Fix Guide


Symptoms

  • Random DNS failures on the network, even though Pi-hole and the system were running.
  • Tailscale logs showed repeated DERP disconnects and timeouts.
  • Device sometimes stayed up but was unreachable; other times it locked until reboot.
  • Power and thermal checks showed no undervoltage or overheating — this was strictly a NIC problem.

The Fix

1. Lock speed/duplex with NetworkManager

Force the NIC to 100 Mbps full-duplex, with autonegotiation off. This lowers heat and avoids flaky gigabit negotiation.

sudo nmcli connection modify "Wired connection 1" \
  ethernet.auto-negotiate no \
  ethernet.speed 100 \
  ethernet.duplex full

sudo nmcli connection down "Wired connection 1"
sudo nmcli connection up "Wired connection 1"

Verify:

ethtool eth0 | grep -E 'Speed|Duplex|Auto-negotiation'

2. Disable Energy Efficient Ethernet (EEE)

The r8152 driver tries to use EEE, which causes instability.

sudo ethtool --set-eee eth0 eee off
ethtool --show-eee eth0

Make it permanent:

echo 'options r8152 eee_enable=0' | sudo tee /etc/modprobe.d/r8152.conf
sudo update-initramfs -u

3. Disable USB Autosuspend

Keep the NIC from being powered down mid-traffic.

/etc/udev/rules.d/99-r8152-no-autosuspend.rules:

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8152", \
  TEST=="power/control", ATTR{power/control}="on"

Reload rules:

sudo udevadm control --reload
sudo udevadm trigger

Sanity Check

  • ethtool eth0 shows 100Mb/s, Full Duplex, Auto-negotiation off.
  • ethtool --show-eee eth0 shows EEE disabled.
  • dmesg | grep -c "r8152 .* eth0: carrier" stays low — no constant flaps.

Future Hardening

  • Add a small heatsink to the Realtek chip (they run hot).
  • Use a NIC with a better chipset (ASIX AX88179) if you want true gigabit.
  • Add a watchdog to auto-restart networking if the link ever dies completely.

Final Verdict

The outages weren’t Pi-hole’s fault, weren’t Tailscale’s fault, and weren’t caused by the Pi itself. The Realtek r8152 NIC was flapping due to autonegotiation quirks and power-saving features.

Locking the link at 100 Mbps full duplex, disabling EEE, and turning off USB autosuspend solved it. The box has been stable since.