Can't get DHCP working on Ubuntu with Asus router

Expected Behaviour:

After setting Pi-hole as my DHCP server, I would like to be able to tell Pi-hole to apply blocking rules to some clients, and to permit others without blocking anything. I'm running Pi-hole on Ubuntu 22.04

Actual Behaviour:

Once I set the Pi-hole as the DHCP server and disable DHCP on my router, I cannot access the internet.

Debug Token:

I don't have a debug token because the upload failed since there was no internet access. I have the local debug log, but I don't know how to get that to the developers without putting it here and potentially putting a bunch of private information out there. Maybe there's no private information and it's fine?

More details

A caveat up front: I'm not the most knowledgeable about Linux or about networking, so there might be something super obvious I'm overlooking that, for whatever reason, isn't covered in the various guides and questions I've looked at.

I have an Ubuntu server on my network for other things, so I figured as long as I'm running a server, I'd install Pi-hole on it and block some ads. I got it to the point where it would function, but it kept on throwing an error message that said "no address range available for DHCP request via 'xxx' ", so between that and other issues I decided to reinstall Ubuntu, and now I can't get Pi-hole to function as the DHCP server.

I have an Asus RT-AX82U router if that makes a difference for some reason.

First, I go into my router and set a static IP for my Ubuntu server:

Next, I go into the Pi-hole web interface and set DHCP server to yes. I make sure the router IP address is correct and leave the IP addresses to hand out as the default.

Next, I got back to my router and set the DNS server to be the IP of the Ubuntu server:

Finally, I enter the name of my Ubuntu server into the domain name field in the router interface (I don't think this makes a difference because I didn't enter anything in here last time and I still had the same result), I turn the DHCP server on the router off, I apply, and I reboot the router. Now I don't have internet access.

I'm happy to provide whatever other information I can, and thank you to anyone who tries to provide some assistance.

*EDIT: last thing I forgot to mention - when I lost all internet connections on all my devices, I hooked up a keyboard and mouse to the Linux server (I couldn't connect to it via ssh) and ran "ip addr" to see if the machine was maintaining the static IP I assigned it. The IP address it returned appears to be a IPv6 address rather than an IPv4 address. It seems like this could be the problem - the Ubuntu box isn't respecting the IPv4 static IP I'm setting in the router and is giving itself an IPv6 address, but I have no idea how to prevent this or change it once it happens.

Ok, this can be tricky.

So you want Pi.Hole to be the DHCP server rather than the router. Not a big deal.

I see you have a small DHCP range - again not a problem.

You will need Pi.Hole and the router to be with fixed IP addresses.

Looking at the last picture there are IP numbers in the DHCP range.
Although you have it set to NO, I am not sure that is a good idea.

I'm guessing your Pi.Hole IP is 192.168.50.12?

Anyway, things to try:
Do as you say and things don't work.
On one machine open the IP settings and check the DHCP settings and the DNS and gateway IP addresses.

I am suspicious you may be pointing things into a loop and then requests are getting stuck between the router and the PiHole machine.

For the sake of it, can you post your PiHole machine's IP address, and the router's IP address.
As in the 192.168.x.x value/s.

Oh, and what the other machine's have set as their gateway and DNS servers. (IP addresses)

Thanks for your help. I think it's working now - after you said turning DHCP on the router to off might be a bad idea, I left it on and kept everything else the same, and now I'm not getting any Pi-hole warnings, it's showing all the individual clients in the query log, and I can put clients into groups for either blocking or not blocking.

Ok, just to clear things up:

It is ok to have DHCP running on either machine. But not both!

That has it's own set of problems:
You have two machines issuing IP addresses to new devices and your network will scream to a halt with messages flooding it because of the two machines doing their job (DHCP)

If you turn it off on the router, make sure the values are empty. What I saw on the screen shot was it was turned off but still had values for the DHCP range.

I'm not saying that is a problem, but if that device forgets it isn't the DHCP server, you are only helping the problem of two DHCP servers be worse.

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