DHCP Server stops working

The issue I am facing:

Hi,
I've been using pihole for years now, everything works fine. But in the last 2 days, the pihole DHCP server stopped working twice, which basically broke everything on my network.

The loss of connections happens at the same time as the warnings: DHCP packet received on eth0 which has no address. I've checked the doc, but No DHCP context has been configured for this interface. Check your DHCP settings. doesn't really help. And this happens out of nowhere, I wasn't doing anything at that time on my raspberry.

The only solution I found to fix my problem is to enable again the DHCP server of my router to let the devices get their IP address, and then I can disable it again. The warnings in the diagnostics also disappear.

Details about my system:

Pi-hole is installed on the system (not with docker):

  Pi-hole version is v5.13 (Latest: v5.13)
  AdminLTE version is v5.16 (Latest: v5.16)
  FTL version is v5.18.2 (Latest: v5.18.2)

Thanks

1 Like

What device is hosting your Pi-hole, and how is that connected to your network?
Some on-board NIC, or a dongle?

Did you observe those outages immediately after a reboot?

Literally what it says:
There is no IP address attached to your eth0 interface.
If that's the interface that your Pi-hole is configured for, then clients would have no means to reach Pi-hole's DHCP server for renewing their leases, until that interface has an IP address again.
And if that's the only interface on your machine hosting Pi-hole, then client's broadcasts for a DHCP would also never reach that machine.

Thank you for your answer !

I'm running it on a Raspberry Pi 4 (the debug log report is still being generated). The raspberry is directly connected to my router via Ethernet.

[✓] Distro:  Raspbian
[✓] Version: 11

No, for example, the outrage I had this morning happened about 1d after the last reboot of both the router and the raspberry.

Yes, everything is attached to eth0 so I guess that's the problem. But I don't understand why it suddenly loses its IP address, I've set a static IP address for my raspberry on my router.

Here's a detailed report, hope it can help !


But indeed, if I reboot the raspberry while the DHCP server of my router is disabled, the raspberry can't re-connect to the network until I re-enable the router's DHCP server.

Since your RPi is running as DHCP server, it would be preferred if you (also) set a static IP on the Pi-hole host machine.

Run on your RPi hosting your Pi-hole, what's the output of

grep -v '^#\|^$' /etc/dhcpcd.conf

Alright, I've also set the static IP on the pihole DHCP, hope it helps !

Here's the output (when the network is working):

hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private
interface eth0
        static ip_address=192.168.1.14/24
        static routers=192.168.1.1
        static domain_name_servers=9.9.9.10 149.112.112.10

I think I managed to replicate it consistently.

  1. Reboot the raspberry
  2. I can't ssh into the raspberry (No route to host)
  3. Enable the DHCP server of my router (even if DHCP static IP is assigned in both the router + pihole DHCP)
  4. ssh into the raspberry, it works

So there's indeed something wrong with the raspberry getting its own IP first.

Can confirm, this exact same thing started happening on my PiHole recently too. I think there was a recent update that is breaking pihole.

A recent update to what? Raspberry Pi OS, Pi-hole, router software?

I run Raspbian 11 (latest updates) and Pi-hole (latest updates) with no issues.

My bad, too early in the morning, I think it's a recent apt update && apt upgrade. That's when I first started noticing issues with mine. No other updates were done on any other networking equipment.

That said, more digging is required since you're not having any issues. I'll see what updates I installed (several days ago) and report back if I can find them.

Quick update:
This is what is in my history.log for the recent upgrade. Approximately 24hrs after this upgrade was when I started experiencing the same issues as the OP.

Upgrade: libexpat1:armhf (2.2.10-2+deb11u4, 2.2.10-2+deb11u5)

Raspbian OS version:
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye

The issue started to pop after a kernel update for me, indeed.

You can try to edit /etc/network/interfaces with something like this, seems to do the trick for me ! (To edit according to your own config)

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
	address 192.168.1.14/24
	gateway 192.168.1.1
	dns-nameservers 9.9.9.9

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.