PiHole impeding static IP assigning from DDWRT to devices

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
buffalo0207
Posts: 34
Joined: Wed Sep 16, 2015 2:08 pm
Location: London

PiHole impeding static IP assigning from DDWRT to devices

Post by buffalo0207 »

Does PiHole (4.2.2) affect my DDWRT router (Netgear R9000) from assigining static ip addresses?

For quite some time now, it's been hit and miss as to whether some devices in my home network receive a static ip address given out by DNSMasq on my DDWRT router. I have a file that assigns about 80 static ip's but I've had trouble on a few particular devices receiving NO ip address at all. But, if I take PiHole out of the loop, thoses devices get back their assgined static ip addresses again. The devices that always seem to have the most trouble are the ones without their own GUI, like my Netgear Arlo Pro CCTV, ADT alarm and Solar Panel base station - these need to have a static IP as I do not have UPnP enabled on the router and need certain ports opened for them to work correctly. But it's futile when it's hit and miss as to whether they even get an ip address, otherwise I get system failures from these devices not being connected to the internet.

My current setup is with PiHole installed on a Asus Tinkerboard with a static IP address (192.168.10.10) and assigned as the DNS server in the Additional DNSMasq Options of DDWRT...

domain=main
local=/main/
expand-hosts
#
# Assign IP range and DNS settings
domain-needed
dhcp-option=br0,3,192.168.10.1
dhcp-range=br0,192.168.10.101,192.168.10.110,255.255.255.0,infinite
strict-order
cache-size=2048
no-resolv
server=1.0.0.1
server=1.1.1.1
server=192.168.10.10
no-negcache
filterwin2k
#
# Set static IP addresses from USB
conf-file=/jffs/config/static_ip.cfg
#
# Use DNSMasq for IPv6 router advertisements [RADVD]
interface=br0
domain=ddwrt,192.168.10.0/24,local
enable-ra
ra-param=br0,10,300
dhcp-range=::150,::1EFF,constructor:br0,ra-names,5m
dhcp-option=option6:dns-server,[::]
dhcp-option=option6:ntp-server,[2001:470:0:50::2]
dhcp-option=option6:domain-search,ddwrt


(I was told that the lower 'server=' is the first assigned DNS - therefore, PiHole - server=192.168.10.10)

...and my static ip config file is in /jffs/config/static_ip.cfg. Its' format is...

dhcp-host=78:D2:94:99:C7:CC,192.168.10.21,Lounge_ARLO,24h

Also, I have the DHCP server disabled in the Setup > Basic Setup of the DDWRT router, with the following settings...

Use DNSMasq for DHCP ticked
Use DNSMasq for DNS ticked
DHCP-Authoritative ticked
Recursive DNS Resolving (Unbound) UNTICKED
Forced DNS Redirection ticked

I haven't changed any of the settings in PiHole other than using CLOUDFLARE DNS in the Settings > DNS tab.

Are there any settings in Pihole that will allow ALL my static IP's to be distributed without failure, or do I need to go to the DDWRT forum?

Thanks...
User avatar
WarHawk
Posts: 610
Joined: Thu Jul 20, 2017 8:55 am

Re: PiHole impeding static IP assigning from DDWRT to devices

Post by WarHawk »

Use pihole to assign IP's...two DHCP on one subnet is going to create issues

I had to do the same thing on my DDWRT, change from DHCP-server to DHCP-forwarder, then in pihole under the DHCP you can assign static IP's to MAC addresses inside your LAN
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: PiHole impeding static IP assigning from DDWRT to devices

Post by MichaIng »

On the other hand also Pi-hole DHCP server can be disabled.
buffalo0207
Posts: 34
Joined: Wed Sep 16, 2015 2:08 pm
Location: London

Re: PiHole impeding static IP assigning from DDWRT to devices

Post by buffalo0207 »

Thanks for the replies. DHCP on PiHole has always been disabled. Besides, I'd rather keep the Static IP assignment on the DDWRT as I have alot of static IP's to be assigned and as I have it on a USB attached to the DDWRT router, it is easier to just put a one line link into DNSMasq Additional Options on the router.

Could there possibly be some setting in PiHole that needs to be changed, or does this need to be resolved at the router level?
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: PiHole impeding static IP assigning from DDWRT to devices

Post by MichaIng »

@buffalo0207
I just recognized that your Pi-hole server address is out of range of the DHCP server:
dhcp-range=br0,192.168.10.101,192.168.10.110,255.255.255.0,infinite
I am not 100% sure how DDWRT handles this, but e.g. in my router the DHCP/IP range must include all devices attached to this network. You can then select a certain connected device and attach the current DHCP assigned IP as static.

Also note that sometimes it is still required to run the DHCP client on all attached devices. Some routers accept devices that come with a client side assigned static IP in the correct range, some router only accept devices that ask for an IP via DHCP client and the IP can only be made semi-static within the router settings.
buffalo0207
Posts: 34
Joined: Wed Sep 16, 2015 2:08 pm
Location: London

Re: PiHole impeding static IP assigning from DDWRT to devices

Post by buffalo0207 »

Yes, the reason it is out of the DHCP server range is that I also had asked for some help from the DDWRT community, and a Guru (jxm) there said that I should assign static ip's outside the DHCP server. Therefore, I have all my static ip assignments from 192.168.10.2 to 192.168.10.100 and my DHCP server range is 192.168.10.101 to 192.168.10.110.

jxm said...

'...allocate Static (or reserved) IP addresses in DHCP to those devices that need a fixed address, making sure that the addresses that you allocate are not within the scope dedicated to the DHCP server. Follow these few simple rules and your life will be happy again.'

In consideration to this advice, I hadn't mentioned that I had 'PiHole' to the DDWRT community at the time as it wasn't until after the fact that I realised that Pihole was the issue. Should I change the DHCP server range on my router to include the full static ip range?
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: PiHole impeding static IP assigning from DDWRT to devices

Post by MichaIng »

If I understand the quote correctly, the idea indeed is not to assign static IPs outside of the DHCP range, but instead within the DDWRT DHCP settings assign "fixed" IPs for the devices where required. So it is still under control of the DHCP server, but it simply assigns/renews always the same IP for configure MAC addresses/hosts.

Check our if you can do such in DDWRT, usually it is possible. Then on the Pi-hole machine (re)enable DHCP.

This is as well how I handle it in my home network. All clients use DHCP, but all known get a fixed IP via router settings.
buffalo0207
Posts: 34
Joined: Wed Sep 16, 2015 2:08 pm
Location: London

Re: PiHole impeding static IP assigning from DDWRT to devices

Post by buffalo0207 »

@MichaIng
I'm getting a little confused, as I understood the part of the quote, '...making sure that the [static] addresses that you allocate are not within the scope dedicated to the DHCP server.', to mean not to assign my static IP's within the DHCP server range.

Therefore, keeping in mind that all my static IP's are between 192.168.10.2 to 192.168.10.100 (about 80 of them) and I'd like for them to remain on the USB of my router for the sake of port forwarding etc, could you possibly clarify the following:

1. Should they be within the DHCP server range of the router, or not?
2. If they are to be within the range, should the static IP address of my PiHole be also in this range?
3. If they are to be outside the DHCP server range, where should the static IP address of the PiHole be? Inside or out?

In consideration to the above, what default settings (if any) need to be changed on the PiHole to accomodate the DHCP server settings of the router?

Thanks...
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: PiHole impeding static IP assigning from DDWRT to devices

Post by MichaIng »

@buffalo0207
As far as I understand the quote is that you should "allocate Static (or reserved) IP addresses in DHCP" which then assures "that the addresses that you allocate are not within the scope dedicated to the DHCP server". So (as below) you make all local network devices connect to the network via DHCP client and leave the IP allocation to the router/DNSMasq. In opposite to making clients assign static IPs themselves (thus not using DHCP clients at all), you let DNSMasq assign "reserved" IPs, but still via DHCP server <> client connection.

Since Pi-hole is a modified DNSMasq as well, you really need to make sure that it's DHCP functionality is disabled.
buffalo0207
Posts: 34
Joined: Wed Sep 16, 2015 2:08 pm
Location: London

Re: PiHole impeding static IP assigning from DDWRT to devices

Post by buffalo0207 »

Ah, thanks. That actually makes sense now. I'm going to test this and let you know...
Post Reply