I'm out of DHCP. How should I get more?

I just installed a few more shelly devices (which are wifi switches based on esp8266s) and I am having trouble with some devices not being able to get dhcp when connected.

I can reset the router and the devices affected seems to change.

Here’s the background:

  • I have a dd-wrt router using dnsmasq. I have manually configured it to reserve each mac address on it’s own IP. I have about 64 devices (suspicious) in my spreadsheet.
  • I have another dd-wrt that I have configued as an access point. It is hard wired, and allows other wifi devices to connect to the same LAN but from the other end of the house.
  • I have probably 6-10 ESPHome devices.
  • I have probably 6-10 WLED devices.
  • I have probably 12 shelly devices (about 8 of these are new this week).
  • The rest are normal stuff, chromecasts, computers, cell phones, etc.
  • I don’t really want any of these things connecting to the cloud unless it is critical for their functionality.

I had a device this morning that could connect to the wifi, but couldn’t get a dhcp address. This is the issue I’ve seen since I added the last 8 devices. It was a chromebook. I configured it to use a static IP address on the device (not in the router settings) and it connected fine.

I have had other devices this week that couldn’t get a dhcp address, and I rebooted the router(s). These devices were fine after the reboot. But I believe I just pushed the problem to some other device. Whichever one was the last to connect.

So here are the options I see:

  1. I can make some of the devices use static IP addresses. This is a cheap and easy option today, but if they ever get “lost” and can’t connect, it will be a pain to reconnect them. Especially if they are hard wired in behind a switch like the shellys. I also use the dhcp status page to remember which device is on which address. I can use my spreadsheet, or make a page of links, but the dhcp reservations are a bit simpler.
  2. I can buy another router. I can put some of these devices on it, don’t give it Internet and add an interface for home assistant to connect to this network. This would let me administer the IP addresses through one router. I may need to have the home assistant machine provide NTP/SNTP for these devices to work properly.
  3. I could buy a better router. I’m not sure where the limit is coming from. I like dd-wrt for some reason and I’ve used it forever. Those ubiquity things look expensive and they require a lot of mouse clicks to get going IMO.

Is there another solution I haven’t thought of? Is there something in these options I’m not thinking through?

I guess after writing this all up, I will start by pushing 10 or so devices to their own static IPs and see where that leaves me.

This is off topic, it has nothing to do with Home Assistant.
But you have a few options, this is basic network tech.
There are a few ranges that are reserved for LAN use.
192.168.x.x is meant to be used for class C network, ie. 256 devices.
172.16.x.x is meant to be used for class B network, ie. 16384 devices
10.x.x.x is meant to be used for class A network, ie A LOT :smiley:

So if you want a bigger scope and you are on 192.168.x.x then you can create a super-net with a mask of 23.
Or you can go for one of the other scopes.

3 Likes

I quit using the dd-wrt dhcp server when it started to get to long to hand out ip addresses. Now I’m using a pihole as dns/dhcp server.

1 Like

I was just poking around at the dnsmasq on the router (I love having ssh on my router). There are exactly 50 leases in /tmp/dnsmasq.leases. That is suspicious. I bet there is a 50 in one of these configs that needs to be bigger. Of the 64 devices I have in my spreadsheet, some of them aren’t on most of the time.

Yeah it sounds like you have a restricted dhcp range set somewhere.

1 Like

I appreciate that. But 1) This is a problem because of all the devices I am using with HA, 2) There may be a solution in a HA-add on or with the HA blue device I have and 3) There are many users here with similar use cases and knowledge.

I’d like to get this in the right place though. If there is a better category, I am all ears.

The issue isn’t running out of IP addresses (I use 10.0.2.x, and 10.0.1.x) It’s with the dhcp server (I believe). I have assigned addresses in a system between 10-99 and I let the server assign new devices in the 100-150 range. That’s not what I’m running out of.

That’s a good idea. I have been meaning to do a pi-hole setup anyway.

Luci (the web UI for dd-wrt) ran out a while ago, but I have been adding items one at a time in the ‘Additional dnsmasq options’ part of the web ui. It works OK, but I have to generate the text somewhere else or I would fat-finger something every time.

I had my dd-wrt router set to hand out ip addresses in the range 10.0.0.27-10.0.0.251, but when I started to add tasmota devices, it took longer and longer to hand out ip addresses. The dd-wrt could simply not cope.
Now no problem at all. (Having about 100 tasmotas, without the rest)

1 Like

Just adjust the Router’s DHCP server to serve addresses from .100-.250 range. That’ll buy you another 100 addresses that devices on your network can use without having to make any other changes.

1 Like

The problem is, most routers have limited memory. My main router is an Openwrt, and I have 3 dd-wrt’s used as access point. But if you on your tv, and have to wait 5 minutes before your android TV stick gets an IP address, it gets annoying.

1 Like

@francisp, have you tried AdBlock AdGuard for this? The hassio add on for pi-hole recommends that instead. It looks like it would support dhcp. I may set that up, even if I fix the dnsmasq on my router.

FWIW, I have the TP-Link ARCHER-C7 for both my dd-wrts (one is a newer version branded for amazon). They both seem to be pretty responsive. Unless I don’t get a dhcp lease :slight_smile: )

That could be it. I changed these settings in the setup page, which were set to start at 100 and go for 50. I will wait a day or two and see if I can get more than 50 leases:

1 Like

I know about the adguard add-on, but have not tried it. I like redundancy, so I have 2 pi 1 running pihole/mosquitto/Zigbee2mtt (zigbee2mqtt not running one one, but installed/up-to-date) and fail-over-scripts should one crash.

1 Like

I checked today and I have 51 items in that list. I did install AdGuard and I’m going to keep that. But dd-wrt is working again with dnsmasq.

Thank you, everyone for joining and helping me figure this out.

:clap: :bowing_man:

1 Like