What's new

dhcp_staticlist and dhcp_hostnames utility

  • 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!

This is the iOS ASUS Router App listing of OFFLINE devices, using custom_clientlist and Mac Address of device (sorry the screenshot is dimmed as it is offline ):

IMG_847941B29409-1.jpeg
 
I may have a more robust solution though. I did a proof of concept for something similar to the nvram backup and restore utility. nvram parms that you want to back up are listed in a file. For example:
Code:
dhcp1_dns1_x
dhcp1_enable_x
dhcp1_end
dhcp1_gateway_x
dhcp1_lease
dhcp1_start
dhcp1_static_x
dhcp1_staticlist
dhcp1_wins_x
dhcp_dns1_x
dhcp_dns2_x
dhcp_enable_x
dhcp_end
dhcp_gateway_x
dhcp_hostnames
<snip>

The script will then read file line by line which contains the names of the nvram parms and save the nvram settings to a backup file. Similarly for a restore, it will read the backup file line by line and restore the settings. It is nothing as robust as the backup and restore utility though but it should work. Also, there will need to be handling for HND routers because of the way it stores some nvram variables to /jffs/nvarm folder.

Xentrk,

This is how I used one of John's NVRAM Back Restore Utility.
I still have not figured out the name of some of the NVRAM items that I would like to backup and restore ... after some trial and error, I have figured enough items for now, as it helps make full factory reset process each time I flash a new version of firmware more bearable):

Code:
cd /mnt/ASUS
./save-mynvram.sh dhcp_static_x dhcp_start dhcp_end dhcp_staticlist custom_clientlist wan0_upnp_enable misc_ping_x dms_enable enable_samba wollist wrs_protect_enable wrs_cc_enable wrs_vp_enable wrs_mals_enable

Saving dhcp_static_x
Saving dhcp_start
Saving dhcp_end
Saving dhcp_staticlist
Saving custom_clientlist
Saving wan0_upnp_enable
Saving misc_ping_x
Saving dms_enable
Saving enable_samba
Saving wollist
Saving wrs_protect_enable
Saving wrs_cc_enable
Saving wrs_vp_enable
Saving wrs_mals_enable
Backing up previous restore script to /tmp/mnt/ASUS/restore-mynvram.sh.bak

Saved 14 NVRAM variable(s)
Run /tmp/mnt/ASUS/restore-mynvram.sh to restore your saved settings

DHCP: dhcp_static_x dhcp_start dhcp_end dhcp_staticlist
ClientList: custom_clientlist
Enable UPnP: wan0_upnp_enable
Firewall WAN ICMP Ping: misc_ping_x
USB Media Server: dms_enable enable_samba
Wake-On-LAN: wollist
AiProtection: wrs_protect_enable
-InfectedDev Prevent&Block: wrs_cc_enable
-Two-Way IPS: wrs_vp_enable
-Malicious Sites Blocking: wrs_mals_enable

I also use John's Full Backup Utility that backup the /jffs folder, where I pickup all my customized icons for each of the devices.

Code:
cp /tmp/mnt/ASUS/backup/jffs-2018mmddtttt-0000/usericon/*.* /jffs/usericon
 
I spent the afternoon tweeking the nvram backup and restore utility for my firmware on AC88U. I am in the process of identifying the nvram parm changes that have occurred. Stay tuned.
 
Do this instructions work in the new beta3 release?
 
@Xentrik Thanks so much for creating this time saver! Just used v.2.0.5 to mostly great success, except i've noted what appears to be an issue which the script or instructions might need to consider (unless i've just missed this convo somewhere...).

After successfully loading all of my migrated hosts from a prior router, it appeared all went well. Everything looked good until I noticed failures on the network resolving to many of the newly added hosts. Odd thing was that some resolved, others didn't.

With some testing, it appears (to me) that though the the dhcp_staticlist and dhcp_hostnames populate the GUI correctly, the / etc / hosts.dnsmasq file does not get populated with these "back-ended" entries. I noted this as the only hosts which were resolving were ones that I subsequently edited via the GUI.

Is there a method to trigger a rebuild of / etc / hosts.dnsmasq? For now, I am just forcing it to populate by clicking edit / add for each entry on the LAN / DHCP Reservations screen.
 
FYI - Realized have to have spaces between / etc / host.dnsmasq when posting or SNBForums say "You've been blocked" :)

@Xentrik Thanks so much for creating this time saver! Just used v.2.0.5 to mostly great success, except i've noted what appears to be an issue which the script or instructions might need to consider (unless i've just missed this convo somewhere...).

After successfully loading all of my migrated hosts from a prior router, it appeared all went well. Everything looked good until I noticed failures on the network resolving to many of the newly added hosts. Odd thing was that some resolved, others didn't.

With some testing, it appears (to me) that though the the dhcp_staticlist and dhcp_hostnames populate the GUI correctly, the / etc / hosts.dnsmasq file does not get populated with these "back-ended" entries. I noted this as the only hosts which were resolving were ones that I subsequently edited via the GUI.

Is there a method to trigger a rebuild of / etc / hosts.dnsmasq? For now, I am just forcing it to populate by clicking edit / add for each entry on the LAN / DHCP Reservations screen.
 
Hope we can get this added to amtm in the future. Great lil tool to use and very handy!!!
 
Is there a method to trigger a rebuild of / etc / hosts.dnsmasq? For now, I am just forcing it to populate by clicking edit / add for each entry on the LAN / DHCP Reservations screen.
Run the command:
Code:
service restart_dnsmasq
Or just reboot the router like the script mentions.
 
Hope we can get this added to amtm in the future. Great lil tool to use and very handy!!!
The utility will be retired soon as I have been working on updates to the NVRAM Backup/Restore Utility. It will be ready very soon.
 
A change was made in the 384.14 and 384.14_2 firmware that allows users to specify DNS for LAN Clients in the Manual Assigned IP section of the DHCP Server screen. The dhcpstaticlist.sh script has been updated to accommodate the change. The firmware update only impacted the ability to preview or save dhcp_staticlist and dhcp_hostnames in dnsmasq format.

Code:
[3] - Preview dhcp_staticlist and dhcp_hostnames in dnsmasq format
[4] - Append dhcp_staticlist and dhcp_hostnames to dnsmasq.conf.add & Disable DHCP Manual Assignment
 
This was super helpful when setting up my router from scratch. Thanks!

Do you have something similar for setting up names in the network map?
 
This was super helpful when setting up my router from scratch. Thanks!

Do you have something similar for setting up names in the network map?
I would appreciate it if you can test the new version of the nvram-save-restore-utility and provide feedback.
 
Going to give that a try.

First observation: after installation I only have option 1 (install); no option 2 (update).
You will only see the update option 2 if a newer version of the menu exists on GitHub. If the version is the same, the option does not appear. I'll be adding an option to check the project folder for updates like I have on the x3mRouting menu soon.
 
Looks like I need to save, edit, and restore nvram variable custom_clientlist, but I don't understand the syntax...

Each entry looks like this: <name>mac-address>x>y>>

What are x and y on this?

Reason for asking: I have configured my router from scratch and now want to add some (old) devices that are currently turned off (but I know their MAC address), without turning them on.
 
Feedback on the installer:

I don't like it that several files (and a single folder) end up in the root of my flash drive.

I would appreciate it if all files/folders from the utility would be stored within a single folder on the root (suggestion: "nvram"), like we have "entware" and "skynet" folders.
 
Feedback on the installer:

I don't like it that several files (and a single folder) end up in the root of my flash drive.

I would appreciate it if all files/folders from the utility would be stored within a single folder on the root (suggestion: "nvram"), like we have "entware" and "skynet" folders.
Best practice is to use a partition on the USB drive that is dedicated for the utility. You have to create the partition in advance of using the installer. The installer displays a list of available partitions on the USB drive for the user to select from.

Code:
[1]  Install NVRAM Save/Restore Utility

[e]  Exit Script

Option ==> 1
Looking For Available Partitions
[1]  --> /tmp/mnt/AC88U - (/dev/sda7)
[2]  --> /tmp/mnt/skynet - (/dev/sda8)
[3]  --> /tmp/mnt/absolution - (/dev/sda1)
[4]  --> /tmp/mnt/entware - (/dev/sda5)
[5]  --> /tmp/mnt/RT-AC88U-MYROUTER - (/dev/sda6)
[6]  --> /tmp/mnt/swap - (/dev/sda9)

Please Enter Partition Number Or e To Exit
[0-6]:
 
Last edited:
That's indeed another "solution" to my "problem".

I thought some of the script developers recommend to use only 1 partition on the flash drive?

I would still prefer folders instead of partitions, because that's more flexible: partitions need to have a fixed size; folders can "share" the same free space on a drive.
 
Best practice is to use a partition on the USB drive that is dedicated for the utility. You have to create the partition in advance of using the installer. The installer displays a list of available partitions on the USB drive for the user to select from.

Code:
[1]  Install NVRAM Save/Restore Utility

[e]  Exit Script

Option ==> 1
Looking For Available Partitions
[1]  --> /tmp/mnt/AC88U - (/dev/sda7)
[2]  --> /tmp/mnt/skynet - (/dev/sda8)
[3]  --> /tmp/mnt/absolution - (/dev/sda1)
[4]  --> /tmp/mnt/entware - (/dev/sda5)
[5]  --> /tmp/mnt/RT-AC88U-MYROUTER - (/dev/sda6)
[6]  --> /tmp/mnt/swap - (/dev/sda9)

Please Enter Partition Number Or e To Exit
[0-6]:
AB-Solution is dead my friend, let it rest in peace.
Although, I did a fresh install the other day to re-test if Diversion still migrates it.
 

Similar threads

Latest 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!
Top