Back in 2019 I decommissioned an Asus router running Merlin firmware. I'd installed DD-WRT on several earlier devices on various SoCs and decided to do the same with this one (r39267), but then I never wound up putting it into service after all. Now I'm waiting on a Starlink hardware kit and plan to put it in bypass mode and use my own router so I pulled the RT-AC66U out with the intention to update to a current release and use that with Starlink. After some research here I decided to go with r52894 rather than the latest r53323.
I did the upgrade without a reset and everything seemed to come back up perfectly, but then I tested setting a static lease since I will need two of them at the cottage. DD-WRT accepts the configuration, but when the device with that MAC address connects it is assigned an IP from the dynamic pool, not the static IP I specified for it. When I look at the LAN status page the device shows there, with the MAC address I used for the static lease configuration, but the IP address is wrong. The static address I'm trying to assign is within the correct subnet but well outside the DHCP dynamic pool.
I then disconnected from the WiFi AP and connected with Ethernet. I went to the LAN status page and deleted the "DHCP Clients" entry for the WiFi connection with the relevant MAC and rebooted the router to make sure it wasn't just reinstating the old lease, but even after the reboot connecting the laptop with that MAC address still always gets a dynamic IP from the pool instead of being assigned the desired static address.
Next I reverted to r39267 but with a NVRAM clear this time and set it all back up, but again when I configure that static lease it just gets ignored. I have since switched between r39267, r52894, and r53323 several times with a full reset each time, but still no go.
With each of the three releases I have tried this with "Use JFFS2 for client lease DB" enabled, or "Use NVRAM for client lease DB" enabled, or neither. No change however I set those two switches. I also tried configuring the lease with a 1440 minute lease time instead of infinite, but again no change.
This is such an important router feature that I can't believe it has been broken in DD-WRT since at least 2019 and instead I must be doing something wrong, but I can't figure out what it is.
Someone who does not understand basic networking or DHCP whatsoever completely fubar'd that whole point. No DHCP server will hand out IP addresses outside of the configured range of IP addresses. And apparently you do not understand this. _________________ "The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost
"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio
Joined: 08 May 2018 Posts: 14249 Location: Texas, USA
Posted: Tue Jul 25, 2023 22:09 Post subject:
Most any DHCP server hands out IP addresses within whatever the value of "dhcp-range" is, whether a reserved (static) lease's IP address or not, with some exception. Neither udhcpd nor dnsmasq has ever functioned in DD-WRT like ISC dhcpd can that I am aware of. For example, from a sample dhcpd.conf file for ISC dhcpd:
Code:
# Define a host named thecrue, and statically
# assign an IP address to it
host thecrue {
hardware ethernet 00:24:8c:4e:07:f6;
fixed-address 192.168.1.2;
Thanks for pointing out a (possible) long-standing gross misunderstanding error in the wiki. It's been fixed. Quite honestly, "Static Leases" in the webUI should be changed to "DHCP Reservations" to avoid confusion. Also, I do not recall if using a '-' in a static lease hostname cause dnsmasq to not start or not as the udhcpd applet from busybox is no longer being used, whatsoever. Maybe @mrjcd will chime in and offer some insight. If this is an actual bug as determined by others, then we'll work on resolving the issue, but I have never known DD-WRT to use IP addresses outside the DHCP pool for static leases. _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net
10.72.28.1 ~ 10.72.28.254 ...minus the 10.72.28.13 router's IP
DHCP start IP is 10.72.28.64
Max I have set is 100
AND I also have a br1 guest net which uses much small DHCP pool.
I do have some devices set as static DHCP for br1 also...
...they are outside of its DHCP handout but NOT outside if its DHCP range.
br1 static DHCP is towards bottom of list
yeahuh just for hellofit I have always used infinite ( 0 time ) for static DHCP stuffs
As it is easier to administer and copy/paste from a text file.
You can check with `cat /tmp/dnsmasq.conf` that the leases from the the GUI are also there in the same format and grab them from there to store offline.
Only limited characters are allowed for the hostname but hyphens and underscore should be allowed.
The picture you showed is from an ancient build, make sure that after an upgrade you not only reset to defaults and put settings in manually, if you come from an old build, but also clear your browser cache.
Note that modern appliances (phones, laptop) usually use random MAC addresses, so those will not adhere to static leases unless that is switched off.
Mostly you can turn off the random MAC address on a per wifi base so that you can switch it off only for your home wifi but still use it on the road. _________________ Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399 Install guide R7800/XR500:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614 Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Joined: 08 May 2018 Posts: 14249 Location: Texas, USA
Posted: Thu Jul 27, 2023 22:39 Post subject:
Wiki edit duly reverted and text formatting added in one fell swoop. I presume blank least time field is intentional masking or equals "infinite" for lease time. One thing I have noticed between working examples and the OP is that the OP's lease is all caps. Try changing that up or using the Winblows / Linux hostname (or set that to be what you want it to be in the lease)? _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Joined: 04 Jan 2007 Posts: 11564 Location: Wherever the wind blows- North America
Posted: Fri Jul 28, 2023 15:15 Post subject:
kernel-panic69 wrote:
I presume blank least time field is intentional masking or equals "infinite" for lease time.
Yes...blank is infinite. I have in the past set a few infrequent connections to 720 so the leases expire and don't show a connection in my list after 12 hours.
Code:
exa....In cmdline format:
nvram set static_leasenum=2
nvram set static_leases="40:F3:XX:XX:XX:XX=cj-tab10=192.168.1.34= 5A:0F:XX:XX:XX:XX=bc-phone=192.168.1.80=720"
nvram commit
The space after the 34= indicates it's an infinite lease....if it was the last lease in the line (below) then it would be ".....1.80= " The space here after 80= would still be needed for proper formatting of the variable.
Code:
nvram set static_leasenum=2
nvram set static_leases="40:F3:XX:XX:XX:XX=cj-tab10=192.168.1.34=720 5A:0F:XX:XX:XX:XX=bc-phone=192.168.1.80= "
nvram commit
Sorry, I'm confused... ddwrt is substantially different from my previous several router web interfaces, and I don't understand how you can assign static IPs outside of the DHCP range. Also, not really sure how to set the DHCP range in ddwrt. Previous router interfaces have all had an IP for the router, and then a specific range that I can set, eg - 192.168.0.1 - 192.168.0.52 , and then I would just click on clients currently connected in a chart/list, and lock them into an IP by MAC address.
...I see that ddwrt appears to have a start IP, and a # of clients, but how can you assign static IPs outside of that?
Joined: 18 Mar 2014 Posts: 12922 Location: Netherlands
Posted: Fri Sep 01, 2023 16:11 Post subject:
ghent96 wrote:
Sorry, I'm confused... ddwrt is substantially different from my previous several router web interfaces, and I don't understand how you can assign static IPs outside of the DHCP range. Also, not really sure how to set the DHCP range in ddwrt. Previous router interfaces have all had an IP for the router, and then a specific range that I can set, eg - 192.168.0.1 - 192.168.0.52 , and then I would just click on clients currently connected in a chart/list, and lock them into an IP by MAC address.
...I see that ddwrt appears to have a start IP, and a # of clients, but how can you assign static IPs outside of that?
The advice is to set static leases outside the DHCP range
Joined: 13 Aug 2013 Posts: 6872 Location: Romerike, Norway
Posted: Sat Sep 02, 2023 18:38 Post subject:
Have the dhcp pool start at 100 is a bad idea. 100 is not a round binary number and cannot be addresses by a nettmaskene. 128 is 10000000 and is a boundry. Makes it easier later when you start with pbr.
So, I guess I was thinking since the DHCP service assigns all the IPs, that there was no possible way to assign a static IP outside of the "range". I guess I'm wrong? So I need to set all my static IPs, for example, from 2 - 29, then start the DHCP range at 30 for 10 clients ...or however many other clients, like visiting family devices. I don't want to allow many, for my home network, maybe only 10.
also, there is no "+" sign after each DHCP client in the Status > Lan page. There is only a "delete lease" trash can icon. ddwrt version: Firmware: DD-WRT v3.0-r46446 mini (04/24/21)
Joined: 18 Mar 2014 Posts: 12922 Location: Netherlands
Posted: Tue Sep 05, 2023 6:20 Post subject:
ghent96 wrote:
what's "pbr" ?
For unrelated questions start a new thread
ghent96 wrote:
So, I guess I was thinking since the DHCP service assigns all the IPs, that there was no possible way to assign a static IP outside of the "range". I guess I'm wrong? So I need to set all my static IPs, for example, from 2 - 29, then start the DHCP range at 30 for 10 clients ...or however many other clients, like visiting family devices. I don't want to allow many, for my home network, maybe only 10.
Correct
ghent96 wrote:
also, there is no "+" sign after each DHCP client in the Status > Lan page. There is only a "delete lease" trash can icon. ddwrt version: Firmware: DD-WRT v3.0-r46446 mini (04/24/21)