What's new
  • 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!

Saving the multiple DHCP Static Lists and Custom Client Lists from 3006 Routers with Guest Network Pro?

jksmurf

Very Senior Member
As noted a few times in various posts I’ve been using WinSCP and just saving several files from the router containing dhcp reservation details, then copying them back into /jffs/nvram, for many years, without issue.

For one fixed DHCP list (under the LAN, DHCP tab) that 3004 FW had, it worked fine for me (although I will admit @Tech9 noted some concerns).

There are currently (now) 4 methods I know of for saving just the DHCP Lists (excluding Backupmon which does a wholescale backup). These are:
  1. Via SSH (putty etc.) using the nvram commands summarised in this post; credit to @ColinTaylor
  2. Using WinSCP by just copying (drag and drop) the dhcp_staticlist and custom_clientlist files from /jffs/nvram across to a local drive (and back when you needed to); this was my preferred option, see attachment.
  3. Via the YazDHCP Addon, which I do not use, so I have no idea how it works; I am loathe to install it just for the backup feature and as RMerlin noted here, Guest Network Pro adds Static Lists for Guest Networks, so YazDHCP is less relevant in that regard.
  4. Via amendments to the dnsmasq.conf.add file that already exists in /jffs/config/ used by Jeffrey Young who references this source for format.

    Line format is:
    Code:
    dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][,tag:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]

    Example from Jeffrey Young, with lease time:
    Code:
    dhcp-host=00:90:A9:3B:5F:01,192.168.0.14,homecloud,3600
However with the advent of additional lists in Guest Network Pro VLANs (see attachments), albeit only 32# for each VLAN (think lots of IoT devices...), I am unsure where these additional lists are saved. I looked in the dhcp_staticlist and custom_clientlist files but they are not populated with Guest or IoT VLAN DHCP details. The original ones (for the Primary Network) remain unchanged however.

So, does anyone know:

(i) where these new lists are kept; and
(ii) can I download them or access them as before and upload replacements if I ever do a factory reset, without borking the entire system?

It's no good exporting the Client List from the Network Map (even though you can do this), because that is just a snapshot of what is online at any one time and you can't put it back anyway.

I am happy to input most setup details from screencaps, but the total 64# DHCP in the primary network PLUS now up to 32# (times five VLANs???) is a lot of IP Addresses and Custom Names to enter back by hand.

Ta.

[EDIT] To add the very useful and still reasonably simply dnsmasq.conf.add approach used by Jeffrey Young
 

Attachments

  • Backup Lists.jpg
    Backup Lists.jpg
    93.8 KB · Views: 23
  • Only32.jpg
    Only32.jpg
    23.5 KB · Views: 23
  • StaticListIoTNetwork.jpg
    StaticListIoTNetwork.jpg
    63.3 KB · Views: 23
Last edited:
Has anyone tried creating a /jffs/scripts/dnsmasq.postconf file to manually assign IP addresses to Asus-Merlin 3006.102_x Guest Network Pro clients? If it works, similar or the same as it does under the 3004 firmware (when using YazFi), it may provide another way to backup the GNP manual reservations (when "Use same subnet as main network" is disabled in GNP's settings).

Was waiting for the Asus-Merlin firmware to hit beta on the RT-AX86U Pro before trying to take a stab at a dnsmasq.postconf file for Guest Network Pro IP reservations.
 
Last edited:
I have always used a dnsmasq.conf.add file to add my static dhcp entries. Easy to maintain, and easy to keep a backup copy. With 3006 out, there is a dnsmasq instance per SDN now. Merlin has added a dnsmasq-INDEX.conf.add so you can add to each instance.
 
I have always used a dnsmasq.conf.add file to add my static dhcp entries. Easy to maintain, and easy to keep a backup copy. With 3006 out, there is a dnsmasq instance per SDN now. Merlin has added a dnsmasq-INDEX.conf.add so you can add to each instance.
Nice, thank you. This would be a new way to do it for me.

I could WinSCP the dnsmasq.conf.add file and dnsmasq-INDEX.conf.add files (one for each VLAN) from the /jffs/config directory on the router to my desktop, add or amend lines with a little help from some concatenation/parsing/sorting in Excel, copy back to the dnmasq text file and then re-upload it to /jffs/config. Does it have any issues with existing dhcp entries or does it just start afresh each time?

Quick question, this SDN Index, is that the VLAN No? So e.g. if I have VLAN 53 it would be dnsmasq-53.conf.add?
 
Last edited:
In addition to the dnsmasq-INDEX.conf.add mentioned above, there is also dnsmasq-sdn.postconf. From the 3006 change log:

3006.102.1 (28-Jun-2024)
- NEW: Added dnsmasq-INDEX.conf.add and stubby-INDEX.yml.add, which are appended to SDN config files (INDEX = SDN index number)
- NEW: Added dnsmasq-sdn.postconf and stubby-sdn.postconf.
They take two arguments:
- path to the config file for that SDN's instance
- the SDN index number (1 for the first SDN instance)
 
In addition to the dnsmasq-INDEX.conf.add mentioned above, there is also dnsmasq-sdn.postconf. From the 3006 change log:

3006.102.1 (28-Jun-2024)
- NEW: Added dnsmasq-INDEX.conf.add and stubby-INDEX.yml.add, which are appended to SDN config files (INDEX = SDN index number)
- NEW: Added dnsmasq-sdn.postconf and stubby-sdn.postconf.
They take two arguments:
- path to the config file for that SDN's instance
- the SDN index number (1 for the first SDN instance)
Thanks bennor...hmmm OK ... well of those, I think I only understand (now) what dnsmasq-INDEX.conf.add does.

If the other items are needed for the swift backup and reload of dhcp static reservations, or at least useful for them, I think my feeble brain is going to need some more explanation and some examples to clarify them, for the purposes of this particuar query :).

[EDIT] Another quick question, will these entries in dnsmasq.conf.add or dnsmasq-INDEX.conf.add show up in the WebGUI? A separate thread suggests no, is this still the case? Maybe I had looked at this approach a long time ago and was probably why I stuck with the simple dhcp_staticlist and custom_clientlist transfers, which "do" populate the GUI with entries (or they always did for me anwyay). I'd really like the GUI to be populated, the limit of 64 (Primary) and 32 (per VLAN) notwithstanding.
 
Last edited:
You can add static DHCP entries using either the /jffs/configs/dnsmasq.conf.add config file or the /jffs/scripts/dnsmasq.postconf script.

The dnsmasq.conf.add is useful if you are just looking to add additional config options to the dnsmasq config file that are not normally dynamically added by Asus during the startup process. In this case, the dhcp-host= directive is generally not a dynamically built option at startup, so adding an example like this in a dnsmasq.conf.add file is usually nice and easy.

Code:
dhcp-host=50:7b:9d:31:2f:c2,192.168.189.6,nc,86400
dhcp-host=00:1B:A9:BF:12:8E,192.168.189.13,printer,86400
dhcp-host=E8-FB-1C-DC-B9-AB,08-26-AE-33-52-64,192.168.189.16,slyjay-ltop,3600

Since the file is not a script, you don't need to add any execute permission or the she-bang (#!).

The dnsmasq.postconf script is an actual script and is best used when you are looking to alter or delete a configuration option in the dnsmasq configuration that is normally dynamically added during startup. This script is called right after the router dynamically builds the default config file for dnsmasq, but before dnsmasq is started. So, in addition to changing options in the config file, you could also run other functions, if you needed too, before letting dnsmasq start. Merlin has a number of helper scripts to assist with this. So, to use the dnsmasq.postconf script, you would add something like this...

Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh

pc_append "dhcp-host=50:7b:9d:31:2f:c2,192.168.189.6,nc,86400" $CONFIG
pc_append "dhcp-host=E8-FB-1C-DC-B9-AB,08-26-AE-33-52-64,192.168.189.16,slyjay-ltop,3600" $CONFIG

as an example of how I use the dnsmasq.postconf script to delete all the extra config options that Asus puts in for the br1 and br2 bridges that I don't use, I have this for my dnsmasq.postconf script;

Code:
#!/bin/sh

CONFIG=$1
source /usr/sbin/helper.sh

pc_delete "br1" $CONFIG
pc_delete "br2" $CONFIG

. /opt/share/diversion/file/post-conf.div # Added by Diversion
cat /jffs/addons/YazFi.d/.dnsmasq >> /etc/dnsmasq.conf # YazFi

Notice how JackYaz uses this script to append dnsmasq options to the actual dnsmasq config file for his YazFi script (adds the DHCP server options for the guest network).

I don't believe the GUI will be updated as that info comes from the nvram settings. For the 3006 firmware, I beleive the INDIX number is the SDN number and not the VLAN ID. I suspect the first SDN is INDEX 1, the second SDN would be INDEX 2, and so forth. I would have to wait until I upgrade to the 3006 base before I am certain.
 
Thank you, really appreciate you taking the time to explain that in the level of detail you have. Will need to try, with some trepidation, hopefully I will not stuff up my current lists.

Even if they do not actually populate the GUI reservations, presumably the dnsmasq.conf.add dhcp details still show up in ASUS (often flaky*) Network client list screen, so you can still see which device is online?

I will probably experiment with all this once the format of the INDEX files is more well defined, along with the new nvram variables for GNP VLAN manually assigned dhcps that dave14305 mentioned briefly above, which (???) could potentially be copied back and forth like dhcp_list and custom_clientlist.

* As an aside I’m seeing devices I have assigned to the VLAN and set addresses for there e.g. 192.168.53.33 that have attached themselves to a mesh node, show up (incorrectly IMO) in the client list of the Primary LAN which is my 192.168.9.x subnet. VLAN Clients that latch on to the primary router Wi-Fi list themselves correctly. Odd.

[EDIT] Rambling…

Not being ungrateful, I do very much appreciate that you’ve shown there is a way to achieve what I’m after. While all those methods are certainly doable and I think I could personally work it out, gee wouldn’t it be great if there was a simple GUI utility or failing that, an Addon (DHCP_IO_Mon?) in amtm whose sole purpose was to easily and reliably export and import all the DHCP lists in csv or txt format, ones that did populate the GUI (even with the limitations on numbers), so that we don’t all need to go clonking around under the hood?

I appreciate many of you network specialists (which I am definitely not) prefer ssh, working with files with indecipherable names and meanings, the flexibility it provides and all that, but I’m thinking in this day and age, surely these things could be a wee bit simpler?
 
Last edited:
Speaking from the school of hard knocks!! When you start down the path of experimenting, I suggest that you follow this order;

1. Find out what dnsmasq processes are running on your router. From an SSH shell, do a ps | grep dnsmasq and note the output.
2. Make your dnsmasq.conf.add file or dnsmasq.postconf script.
3. Test it by restarting dnsmasq (service restart_dnsmasq), then check that the process is alive (ps | grep dnsmasq). You should get the same output as in step 1.

If you mucked up something in your config file, and that is not hard to do - you just need to forget a comma or have a malformed MAC address, dnsmasq will fail to start. When that happens, your devices won't be able to get a DHCP lease. If you do run into troubles, check your syslog to see what dnsmasq is reporting. Being already connected to the router is a big help. The first time I mucked something up, I did not find out about it until after I signed off and closed my computer. I had to assign my laptop a static IP address in my LAN's subnet so I could SSH back into the router and find out where I goofed - it was a period inserted instead of a comma.
 
Not being ungrateful, I do very much appreciate that you’ve shown there is a way to achieve what I’m after. While all those methods are certainly doable and I think I could personally work it out, gee wouldn’t it be great if there was a simple GUI utility or failing that, an Addon (DHCP_IO_Mon?) in amtm whose sole purpose was to easily and reliably export and import all the DHCP lists in csv or txt format, ones that did populate the GUI (even with the limitations on numbers), so that we don’t all need to go clonking around under the hood?

Well, you do have to remember the target audience for Asus when it comes to these routers. It is not us techy's! There is much better hardware on the market that will do what you are looking for, but they are not always as easy to set up as they are geared to the tech heads. Merlin just spoils us by giving a wee glimpse at what true commercial grade routers are capable of :)
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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