DHCP server not working

Please follow the below template, it will help us to help you!

Expected Behaviour:

[Replace this text with what you think should be happening]

Clients connect to network and are assigned an IP address

Actual Behaviour:

[replace this text with what is actually happening]

Devices will not be assigned an IP, can only connect if they give a static IP.

Debug Token:

[Replace this text with the debug token provided from running pihole -d (or running the debug script through the web interface]

https://tricorder.pi-hole.net/m1deou6urp

Look in /var/log/pihole.log and see if the DHCP requests are appearing, and if they are appearing, if they are being answered with an IP. If there is a difference when the IP is static, you should be able to see it in the log transactions.

I don't really know to be honest, I just checked the log before and after trying to connect using DHCP then with a static IP and there doesn't seem to be anything about any of it.

If the client is receiving DHCP from Pi-Hole, then these transactions will be in your Pi-Hole logs. You can also check yesterday's log at /var/log/pihole.log.1

But that's the problem. If I try to connect using DHCP then no IP gets assigned and the client does not connect.

If a client requests and IP from Pi-Hole, there is a record of the request in the pihole log. If no request is made, then Pi-Hole won't assign an IP. So, if you don't see a request, the problem is in the client.

I assume at one time the router was providing DHCP? After you changed this to Pi-Hole, did you reboot the router and all clients, and then clients were able to get an IP from Pi-Hole? Or have clients never been able to get an IP from Pi-Hole?

It's definitely not a problem with the clients.

This has been working fine using pihole as DHCP until this even when I had a powercut. When I brought the power back up no clients would reconnect to the WiFi.

If I disable the pihole DHCP and reenable in my router all suddenly connect up. Switch back and they won't connect.

Last DHCP request/act in the pihole log is just before the power cut.

Or the DHCP server isn't running properly. I seem to be getting errors if I try and restart dnsmasq.

What command are you using to restart dnsmasq? Since Pi-Hole V4, dnsmasq is embedded in pihole-FTL and no longer runs as a separate process.

Ok, so is it best to uninstall it completely then? I was using

systemctl status dnsmasq.service

I know this isn't a client issue, they have no problem connecting to another DHCP server.

I am just trying to avoid completely reinstalling everything on the pi.

I would not reinstall, since I still don't think the problem lies with the Pi-Hole DHCP server. I would try a few things though. If you do wish to reinstall Pi-Hole, you don't have to reinstall everything on the Pi.

Repair pihole with pihole -r - and select repair. This is basically a re-run of the installer script.

I would also put a packet sniffer on one of the clients that is unable to get an IP address with Pi-Hole DHCP. See where the DHCP transactions are going, since they aren't going to Pi-Hole.

Could it not be that the pihole is not listening for DHCP requests? That seems most likely to me.

A packet sniffer sounds like a good idea though, can you give me a bit more info? Then what to look for when I use it?

Yes, but it also could not be advertising itself on the network as a DHCP server. This is how clients find DHCP servers.

Wireshark is a good packet sniffer. Run this and in the captured output look for the DHCP protocol.

Great, thank you. I will try that out once I get home

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