What's new

Backup Manual DHCP List?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

when I run navram set dhcp_staticlist=, it says that
nvram/value pair: is invalid or bigger than its max length

I did several tests. It seems that the dhcp_staticlist has a max size limit. Not sure what exactly it is. But it seems working until 990.

Anyone has the knowledge of what is exact max size allowed for dhcp_staticlist?
 
Last edited:
when I run navram set dhcp_staticlist=, it says that
nvram/value pair: is invalid or bigger than its max length

I did several tests. It seems that the dhcp_staticlist has a max size limit. Not sure what exactly it is. But it seems working until 990.

Anyone has the knowledge of what is exact max size allowed for dhcp_staticlist?

2500 characters according to the GPL code, unless Asus's own shared/defaults.c isn't in sync with wlcsm which does the validation.

https://github.com/RMerl/asuswrt-merlin.382/blob/master/release/src/router/shared/defaults.c#L1157
 
It seems that is not the case in 382.1. It is limited under 1000. That also explained why I can't add static DHCP ip binding from Merlin UI as well after this point.
 
It seems that is not the case in 382.1. It is limited under 1000. That also explained why I can't add static DHCP ip binding from Merlin UI as well after this point.

The code I posted was from 382. However, the RT-AC86U has a second level of validation done inside the (now closed source) nvram library. It's possible that it has a second level of size validation, ignoring the 2500 chars value defined in defaults.c. In that case, there's nothing I can do about that limit. This validation must be separate, because the first validation level actually tells you what's the maximum allowed length - in this case, the error message does not specify it.
 
Hi,

The char limit is present also on AC88u.

Copying cfg file from AC87u (380.68_4) to AC88u (382.1) allowed from the beginning for using a significant larger DHCP static list although AC88u has double NVRAM size compared to AC87u. AC88u was first set on 382.1.

83 static addresses (with several exceptions, names were of 3-4 char at max) amounted to 2950 char, however I couldn't update any entry from the GUI (that is modifying IP or hostname; changing client icon works as it is saved without hitting Apply). The error when trying to Apply was: "Resulting list of DHCP reservations is too long - remove some, or use shorter names."

I've then manually created a DHCP static list in mnt/sda1 and updated NVRAM with this list (nvram set dhcp_staticlist="`cat /mnt/sda1/dhcp`") which works fine and the list is shown also in GUI.
 
All models have the configurable limit, which is currently set at 2500 characters for that variable. The HND limit is a different one, it's a hardcoded limit of only 1000 characters, which cannot be increased even tho the variable is defined to allow up to 2500.
 
Just tried to add 2 more static reservations (I have 75 or so) and hit this error message.

Running 382.1_2. That's the main reason I bought the AC-88U (larger NVRAM for more static DHCP).

Anything I can do about this?
 
Just tried to add 2 more static reservations (I have 75 or so) and hit this error message.

Running 382.1_2. That's the main reason I bought the AC-88U (larger NVRAM for more static DHCP).

Anything I can do about this?

You will have to implement them manually by customizing dnsmasq. That's simply too many for the router's webui/nvram to handle.
 
Thank you. But I think something has definitely changed. I've only ever added address reservations via the GUI.

Now, on a clean load and clean login, I go to the DHCP page, try to remove four existing devices, and then hit apply, and it still tells me it's too long.
 
Thank you. But I think something has definitely changed. I've only ever added address reservations via the GUI.

Now, on a clean load and clean login, I go to the DHCP page, try to remove four existing devices, and then hit apply, and it still tells me it's too long.

I'm seeing similar issues since upgrading to this release with my AC-3100. Granted, my DHCP reservations list was pretty long, but prior releases never complained. I can no longer add new reservations or edit the ones I currently have without getting a message that says "Resulting list of DHCP reservations is too long - remove some or use shorter names."

I'm fine customizing DNSMASQ to implement DHCP reservations if that's the recommended method when one has lots of reservations. Is there guidance on how to best implement this that someone could recommend (I know the basics, just not the entry to add in the DNSMASQ.conf.add file)?
 
Last edited:
I dumped my dhcp_staticlist to a text file and it's 3313 bytes. 78 lines for my current 78 reservations.

I found my /etc (which is actually /tmp/etc) dnsmasq.conf and see a whole bunch (all 78) of my lines for dhcp-host=mac, IP

I created a dnsmasq.conf.add in /jffs/scripts and added a line for my new host. I did a "service restart_dnsmasq" and now see that line added when I cat /etc/dnsmasq.conf but I do not see it (though I do see all my others) on the DHCP web page in the Asus web administration.

Is this expected? Is the web DHCP gui built from nvram and not from dnsmasq though dnsmasq controls dns and dhcp settings?

(My host is actually an appliance and I'd have to trip a circuit breaker to reboot it and force it to a new IP so I'll wait and see if it got the new IP tomorrow, but it would have been nice to still be able to view it in the GUI). Thanks again.
 
Last edited:
Separately, I dumped all of my reservations to a sorted static list per steps in this thread post 2: https://www.snbforums.com/threads/feature-request-sort-dhcp-list-with-ips-or-names.18153/

then edited that file, added my new reservation to the end, ran the sh command with that file and did a nvram commit and that reservation now shows up fine in the GUI.

Is there a command line way to append a new reservation? Or do I have to do nvram set dhcp_staticlist and key in (or rather, have a file) the entire list? (which I have working fine; just wondering if there was a way i didn't have to edit that file and could just add new reservations to nvram from the command line individually).

thanks
 
All models have the configurable limit, which is currently set at 2500 characters for that variable. The HND limit is a different one, it's a hardcoded limit of only 1000 characters, which cannot be increased even tho the variable is defined to allow up to 2500.
382.1_2 fixed it. Now I can add them in. Thanks, RMerlin.
 
I can push new IP reservations via NVRAM but not the GUI (AC88U, so plenty of nvram). These work, show up in the GUI (after doing nvram commit) but don't actually take effect until I reboot the router.

Is there a service (is it dnsmasq?) I can restart so these take effect without a full reboot?
 
Clients are the ones that need to reconnect to get an updated DHCP address so rebooting the router would do it if they're wireless clients or wired directly to the router. Otherwise you need to hit every client to have them refresh their lease.
 
Clients are the ones that need to reconnect to get an updated DHCP address so rebooting the router would do it if they're wireless clients or wired directly to the router. Otherwise you need to hit every client to have them refresh their lease.

That is what I thought. My router was set for the default 24 hour lease. I originally pushed the DNS changes saturday afternoon and then unplugged a few devices; plugged them back in and they did not get the new address. Change a ceiling fan to another wireless access point (Different SSID but same network) and it did not get a new address. Only after rebooting the router 30+ hours later did they all immediately get a new address.

A wired device that I actually had a typo on did not lose it's old address (that didn't have a typo) until the router rebooted; thus my suspicion that it is more than just the "set nvram" and "nvram commit" for the DHCP reservations to take effect.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top