With DHCP disabled on my router and enabled on my pihole. Then devices on my network using DHCP should request an IP address and that IP address would be provided by the DHCP server on my pihole.
Actual Behaviour:
My Pihole does not appear to even be seeing DHCP requests. During the period for my debug log there were many devices on my network trying to get a DHCP lease.
The problem occurred whilst I was moving a few leases from dynamic to static leases.
There's no firewall that might be blocking the traffic. I've reconfigured the pihole to use 192.168.1.3 outside of the DHCP range and the router is pingable.
However, with DHCP marked as 'enabled' in the UI. There still doesn't appear to be anything listening on port 67.
root@pihole:/home/pi# nmap -sU -p67 --script dhcp-discover 192.168.1.3
Starting Nmap 7.70 ( https://nmap.org ) at 2021-12-22 09:06 GMT
Nmap scan report for 192.168.1.3
Host is up (0.00044s latency).
PORT STATE SERVICE
67/udp closed dhcps
Nmap done: 1 IP address (1 host up) scanned in 18.10 seconds
I have never edited this file manually before, so not sure how all of the @ symbols got there. But right before the problem started I did experience some weird behaviour in the UI.
The fact you pointed out that the default gateway wasn't pingable in the debug log was the thread I followed to find the problem. It was certainly pingable from the command line. It wasn't pingable from the debug log because PIHOLE_INTERFACE was not set. It wasn't set because of the rogue characters in the config file.
To prove this I made a minor change to line 684 of /opt/pihole/piholeDebug.sh changing:
When I ran debug again the output was as follows, showing no value for ${PIHOLE_INTERFACE}
*** [ DIAGNOSING ]: Networking
[✗] No IPv4 address(es) found on the interface.
[✗] No IPv6 address(es) found on the interface.
[i] Default IPv4 gateway: 192.168.1.254
* Pinging 192.168.1.254 through ...
[✗] Gateway did not respond. (https://discourse.pi-hole.net/t/why-is-a-default-gateway-important-for-pi-hole/3546)
So right now, I've resolved that much of the issue. The port is now open but still not serving any DHCP addresses.
I found that in /etc/dnsmasq.d/01-pihole.conf the interface line stated
interface=eth0
My pihole is a Raspberry pi Zero W, so there is no eth0 only wlan0.
The headers in the file tell you to make the changes in /etc/pihole/setupVars.conf. But that file already had
PIHOLE_INTERFACE=wlan0
So I ignored the header and went ahead an edited 01-pihole.conf directly.
I think ultimately it comes down to a corruption of /etc/pihole/setupVars.conf that happened whilst I was using the UI to move some DHCP leases from dynamic to static.