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!

I would appreciate it if you can test the new version of the nvram-save-restore-utility and provide feedback.
I gave it a try with my RT-AX88U by first adding a new USB labelled "ASUS" and am happy to report the install worked perfectly and the files created were where I expected them. Thanks for giving this utility another breath!

I am planning on upgrading the router to the new alpha soon and was wondering if the utility is ready to test the restore yet?
 
I gave it a try with my RT-AX88U by first adding a new USB labelled "ASUS" and am happy to report the install worked perfectly and the files created were where I expected them. Thanks for giving this utility another breath!

I am planning on upgrading the router to the new alpha soon and was wondering if the utility is ready to test the restore yet?
It should work. I did many factory reset tests on the 384.13 version I used in the development. I also tested it when upgrading from 384.13 to 384.14. I had issues with Internet Disconnected which ended up being a firmware issue. It worked fine after RMerlin fixed the issues with the 384.14_2 test release.
 
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.
I have not heard of the 1 partition recommendation before. The early versions of Skynet and the former AB-Solution recommended using dedicated partitions on the USB drive. I concur that reformatting the USB to create a new partition and saving/restoring the existing data is a pain in the arse. My goal was to stay as true as possible to the original script, which recommended using a dedicated partition on the USB. I'll make the change to install in a folder in a future update.
 
Last edited:
Hello,

Anyone was able to copy the result files to USB and move it to another Router? Then Restore?
Both with Merlin. Actual Router AC88U --moving to --> AX88U

Thanks
 
It doesn't sound like a good idea to me. If/when you have unexplained issues/glitches in the future, you will never be able to know for sure it wasn't this step that introduced it (or not).

With the results file in a human-readable format, I would rather copy/paste into the new router's GUI instead. ;)
 
It doesn't sound like a good idea to me. If/when you have unexplained issues/glitches in the future, you will never be able to know for sure it wasn't this step that introduced it (or not).

With the results file in a human-readable format, I would rather copy/paste into the new router's GUI instead. ;)

Thanks for the recommendation... just that I have about 100 entries to do :)
 
Hello,

Anyone was able to copy the result files to USB and move it to another Router? Then Restore?
Both with Merlin. Actual Router AC88U --moving to --> AX88U

Thanks
There is a migration mode feature.

Code:
NVRAM User Save/Restore Utility
nvram-save.sh Version 30.3
Options: -h           this help msg
         -v           Print version/perform consistency check
         -b           Backup mode - save for restore to same router (default)
         -m           Migration mode - transfer settings to another router
         -i inifile   Specify custom nvram variable ini file
         -clk         Include clkfreq/overclock setting (Backup mode only)
         -nojffs      Skip backup of jffs storage
         -nouser      Skip execution of user exit script

e.g. sh nvram-save.sh -m

The save/restore file will have a -MIGR on the end of the file name rather than the last four digits of the router's IP address. Please give it a try and let us know how it turns out.

One item that will be different is the dhcp_staticlist and dhcp_hostname nvram variables are stored in /jffs/nvram for HND routers. You can use the dhcpstatliclist script to create a back up of just those two files. Then, copy the contents to /jffs/nvram/dhcp_staticlist and dhcp_hostnames. The code has not been tested when migrating from a non HND router to a HND router. So those two nvram parms may require some manual adjustment. I have remote access to one HND router at a client site. I will look into the nvram vars specific to HND models some more and see if I can account for any adjustments that are required.
 
Last edited:
There is a migration mode feature.

Thanks...tried and encountered some issues. Probably related to go from non HND to a HND router.
I exported from both to compare and there was some differences. Since I had no time to troubleshoot
I went with a manual solution and entered all my DHCP manually. Still have 20 to go... But most important were done first.

Thanks for the help
 
Thanks...tried and encountered some issues. Probably related to go from non HND to a HND router.
I exported from both to compare and there was some differences. Since I had no time to troubleshoot
I went with a manual solution and entered all my DHCP manually. Still have 20 to go... But most important were done first.

Thanks for the help
Thanks for the update. I'm glad you brought up the topic as the migration mode from non-HND to HND router wasn't something I had thought about. I will analyze what is required to account for it. I ended up using the dhcp reservation method in dnsmasq at one site I support that requires 40 dhcp static leases. I found it easier to update and maintain that way.

If you use the nvram save/restore utility on a HND router, the nvram values stored in /jffs/nvram get backed up in the jffs save file. You have to run the jffs-restore.sh script to restore.
 
Thanks for the update. I'm glad you brought up the topic as the migration mode from non-HND to HND router wasn't something I had thought about.
Thanks to you for the follow up! Really appreciated.
 
@Xentrk: not all substitoutions in your script dhcpstaticlist.sh is substituted :)

Lines 27, 28 defines variables DHCP_STATICLIST and DHCP_HOSTNAMES, but these variables are not used in restore functions (lines 233,266)...

I sugest change this:

line 233:
nvram set dhcp_staticlist="$(cat /opt/tmp/dhcp_staticlist.txt)"
to
nvram set dhcp_staticlist="$(cat ${DHCP_STATICLIST})"

line 266:
nvram set dhcp_hostnames="$(cat /opt/tmp/dhcp_hostnames.txt)"
to
nvram set dhcp_hostnames="$(cat ${DHCP_HOSTNAMES})"

regards

S.
 
@Xentrk: not all substitoutions in your script dhcpstaticlist.sh is substituted :)

Lines 27, 28 defines variables DHCP_STATICLIST and DHCP_HOSTNAMES, but these variables are not used in restore functions (lines 233,266)...

I sugest change this:

line 233:
nvram set dhcp_staticlist="$(cat /opt/tmp/dhcp_staticlist.txt)"
to
nvram set dhcp_staticlist="$(cat ${DHCP_STATICLIST})"

line 266:
nvram set dhcp_hostnames="$(cat /opt/tmp/dhcp_hostnames.txt)"
to
nvram set dhcp_hostnames="$(cat ${DHCP_HOSTNAMES})"

regards

S.
The utility is storing the backup files in the entware directory /opt/tmp on the USB drive. Do you have entware installed?

I recommend using the updated NVRAM Save/Restore Utility instead as it provides better flexibility and features. It requires a USB drive with a labeled partition. For example, you can run a full save and restore or for just a few selected nvram values:

Code:
sh save-mynvram.sh dhcp_hostnames dhcp_staticlist

Saving dhcp_hostnames
Saving dhcp_staticlist
Backing up previous restore script to /tmp/mnt/AC88U/nsru/restore-mynvram.sh.bak

Saved 2 NVRAM variable(s)
Run /tmp/mnt/AC88U/nsru/restore-mynvram.sh to restore your saved settings

Stay tuned for a formal announcement and support thread...
 
The utility is storing the backup files in the entware directory /opt/tmp on the USB drive. Do you have entware installed?

I recommend using the updated NVRAM Save/Restore Utility instead as it provides better flexibility and features. It requires a USB drive with a labeled partition. For example, you can run a full save and restore or for just a few selected nvram values

No, I do no not have installend entware and no USB is attached to the router.
Your utility dhcpstaticlist.sh is fine for backup DHCP reservations only. I don't need backup other NVRAM variables. This solution is exact what I need - small and simple. :cool:

Edit: for those who need this, here is your edited script:
Edit2: fix showing backup dir in menu 7


S.
 

Attachments

  • dhcpstaticlist.sh.txt
    12.2 KB · Views: 201
Last edited:
Stay tuned for a formal announcement and support thread...

Looking forward to this - long ever due.
Hats off Xentrk
 

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