What's new

NVRAM [Release] NVRAM Save/Restore 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!

Status
Not open for further replies.
SORRY, my warning is coming too late ...
The script nvram-save.sh is faulty / check right after my ac88u has also failed completely, thanks to BACKUP he is alive again ...
Thanks anyway to Xentrk ... we still find the error ..
best regards...
My mistake. Sorry for any issues. I accidentally uploaded the nvram-restore-xxx.sh file created by the new nvram-save.sh rather then the updated nvram-save.sh script. So you ended up getting a file containing my settings. I have uploaded the correct nvram-save.sh code to GitHub.
 
RT-AX88U, running 384.15
just installed your script the first time

i wanted to backup my settings before updating to the latest beta. Maybe i didnt read the instructions correct, or just did a mistake, but after calling ./nvram-save.sh (what i think makes a backup) your script restored firmware firmware 384.16_beta1 ??
(Restoring RT-AC88U settings from firmware 384.16_beta1 202003191846_RT-AC88U-MIGR)

Now the router is reachable under a different ip, but i cant login. The default admin:admin nether my normal password are working.
I tryed to reset it with the Firmware Restoration tool, wich runs fine. But after a reboot, the router is still on the 192.168.22.1 and no username:password are working.

so atm i'm looked out from my router and have no idea how to take back control?!
I made a bad mistake when uploading the patch for @here1310 which created the issue for you.
https://www.snbforums.com/threads/release-nvram-save-restore-utility.61722/page-7#post-561694

I had a long day at work and was running on fumes. Sorry for causing you problems. I sent you a PM with my userid and pw that should allow you to logon.
 
ahh what a great timing for me :) Im be a developer since 1997 and this one of the craziest bug i have ever encounterd. :)
Thanks for the pn, got it back running and could restore my settings!

Be thankfull in these times, that you still have work. I have more time as i want to have cause of this fcking virus, so it was no big deal! Anyway thanks for your work!
 
I was able to press and hold the RESET button for ca. 30 seconds to reset the router ...
So switch on, wait ca. 5min, then press the RESET button on the back left for 30 seconds. hold down and watch the LEDs ...
 
I was able to press and hold the RESET button for ca. 30 seconds to reset the router ...
So switch on, wait ca. 5min, then press the RESET button on the back left for 30 seconds. hold down and watch the LEDs ...
Good news. I have been feeling bad all day that I made a major goof. I'll double and triple check from now on.

If it messed up your config, you can use the previous migration save. These lines would have to be removed from the nvram-restore file (e.g. nvram-restore-202003191846_RT-AC88U-MIGR.sh) generated by the original nvram-save.sh run to get around the model check.

Code:
if [ -z "$(echo "$(basename "$0")" | grep "$(nvram get model)")" ]; then
printf '%b' "\e[91m\e[5m"
printf '\n\a\t%s' "Restore Router Model MISMATCH - ABORTing"
printf '%b' "\e[0m"
exit 98
fi
 
Hopefully you have now changed ALL of your password/ports etc. given the unfortunate data leak.
I spent time trying to back out the change so it wouldn't show up in the history with my user info. I ended up removing the repo and rebuilding without the history to minimize exposure after fighting thru the git procedure. Credentials that were exposed have been updated too.
 
Last edited:
I pushed a few updates for nvram-save.sh and nvram-user-sample.sh

nvram-save.sh
1. Removed the dash that was being passed in front of the parameter calling the nvram-user.sh script. An example script called nvram-user-sample.sh is included in the repository which creates a tar backup of the nvram backup files and jffs directory. To use, you will need to copy nvram-user-sample.sh to nvram-user.sh to have it be automatically executed from nvarm-save.sh.

2. nvram-save.sh will now include the firmware version in the header when creating the *.txt files. See the example below:
Code:
NVRAM Saved User Settings 202003210918 RT-AC88U-8248 384.16_beta1

nvram-user-sample.sh
1. Added the "z" parameter to the tar command to compress the tar file using gzip.
 
@ Xentrk:

.. was able to successfully migrate to the ac86u .. the hnd migration script also works!
.. I am still missing adjustments in the merlin.ini regarding wan_upnp and ssh_auto_logout;
Search in the nvram for these parameters to adjust in the ini ...
 
@ Xentrk:

.. was able to successfully migrate to the ac86u .. the hnd migration script also works!
.. I am still missing adjustments in the merlin.ini regarding wan_upnp and ssh_auto_logout;
Search in the nvram for these parameters to adjust in the ini ...
Thank you very much for the feedback! When I tested the UPNP nvram parm, the setting never restored to the original setting after a factory reset followed by a restore. I had to set UPNP manually.

Restoring After a Factory Reset
  • The UPnP setting on the WAN page must be configured manually after running nvram-restore.sh.
  • You will need to acknowledge the TrendMicro EULA upon logging into the router Web GUI if it was previously enabled.
I will look at the ssh_auto_logout setting and report back.
 
thank you too!
the migration from RT-AC88U to RT-AX88U was also successful! thanks ...
now I try / test the configuration including Aimesh, two aimesh nodes, which are connected to the AC88U, to save and restore ...

NVRAM:
asus_device_list
cfg_alias =
cfg_cost =
cfg_device_list =
cfg_group =
cfg_master =
cfg_maxlevel =
cfg_obstatus =
cfg_recount =
cfg_rejoin =
cfg_relist =
cfg_ver =
cfg_wifi_quality =

which still ??

best regards...
 
thank you too!
the migration from RT-AC88U to RT-AX88U was also successful! thanks ...
now I try / test the configuration including Aimesh, two aimesh nodes, which are connected to the AC88U, to save and restore ...

NVRAM:
asus_device_list
cfg_alias =
cfg_cost =
cfg_device_list =
cfg_group =
cfg_master =
cfg_maxlevel =
cfg_obstatus =
cfg_recount =
cfg_rejoin =
cfg_relist =
cfg_ver =
cfg_wifi_quality =

which still ??

best regards...
Thank you for the feedback. I just pushed an update to nvram-merlin.ini to add the additional cfg_xxx nvram parms.

I can't find the other nvram parms you listed: wan_upnp and ssh_auto_logout. I'll continue to investigate later this evening. From my testing, wan_upnp_enable defaults to "enabled" after a factory reset and the nvram restore utility can't override the value. It requires manual intervention using the GUI WAN page to turn off.
 
I have also added the following parameters (advanced settings in VPN clients)
% dnsfilter-costum1 from the ini is not accepted, although it is set to forced ??

cfg_device_list is not adopted and cannot be set later with nvram set / nvram commit, why not ??


[User Adds]
# Add special user vars here
#
vpn_client_cust21
vpn_client_cust22
#
vpn_client1_cust21
vpn_client2_cust21
vpn_client3_cust21
vpn_client4_cust21
vpn_client5_cust21
#
vpn_client1_cust22
vpn_client2_cust22
vpn_client3_cust22
vpn_client4_cust22
vpn_client5_cust22
#
dnsfilter_custom1
dnsfilter_custom2
dnsfilter_custom3
 
I have also added the following parameters (advanced settings in VPN clients)
% dnsfilter-costum1 from the ini is not accepted, although it is set to forced ??

cfg_device_list is not adopted and cannot be set later with nvram set / nvram commit, why not ??


[User Adds]
# Add special user vars here
#
vpn_client_cust21
vpn_client_cust22
#
vpn_client1_cust21
vpn_client2_cust21
vpn_client3_cust21
vpn_client4_cust21
vpn_client5_cust21
#
vpn_client1_cust22
vpn_client2_cust22
vpn_client3_cust22
vpn_client4_cust22
vpn_client5_cust22
#
dnsfilter_custom1
dnsfilter_custom2
dnsfilter_custom3
Thanks for the feedback. What router model and firmware are you on? I made several passes of the nvram parms I had on my AC88U development router and AC86U router I support during development. Especially the vpn client parms since VPN client is something I rely on. Looks like I did specify vpn_clientX_cust2 nvram parms for all of the vpn clients. I'll take a look at it this evening to validate and add it in to the asuswrt-merlin.ini file.
 
HND routers use vpn_server / vpn_clients for "advanced settings" due to restrictions of 255 characters in the parameters cust2 additionally cust21 / 22

When migrating from ac88u to ac86u, I noticed the error when transferring the VPN server parameters and individual clients (I have 5 with different, advanced settings).

The settings on the ac86u were recreated and backup / restore performed then showed the result in terms of using cust21 / 22 parameters

my Conclusion: VPN settings have to be adjusted after the migration to HND routers!
 

Attachments

  • vpn_client.jpg
    vpn_client.jpg
    35.7 KB · Views: 169
Last edited:
i have ac88u, ax86u and ac86u;
Firmware 3.84.15 or 3.84.16_beta2
 
I uploaded two updates to fix the issues reported by @here1310

nvram-merlin.ini
Added missing HND nvram parms for VPN Client/Server
#ifdef HND_ROUTER
{ "vpn_server_cust21", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_server_cust22", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_server1_cust21", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_server1_cust22", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_server2_cust21", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_server2_cust22", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client_cust21", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client_cust22", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client1_cust21", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client1_cust22", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client2_cust21", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client2_cust22", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client3_cust21", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client3_cust22", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client4_cust21", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client4_cust22", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client5_cust21", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client5_cust22", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client_clientlist1", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client_clientlist2", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client_clientlist3", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client_clientlist4", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client_clientlist5", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client1_clientlist1", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client1_clientlist2", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client1_clientlist3", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client1_clientlist4", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client1_clientlist5", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client2_clientlist1", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client2_clientlist2", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client2_clientlist3", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client2_clientlist4", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client2_clientlist5", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client3_clientlist1", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client3_clientlist2", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client3_clientlist3", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client3_clientlist4", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client3_clientlist5", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client4_clientlist1", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client4_clientlist2", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client4_clientlist3", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client4_clientlist4", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client4_clientlist5", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },

{ "vpn_client5_clientlist1", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client5_clientlist2", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client5_clientlist3", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client5_clientlist4", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
{ "vpn_client5_clientlist5", "", CKN_STR255, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
#endif
// These are for HND's 255 chars limitation

nvram-save.sh
Fixed code that was preventing nvram-save.sh from saving nvram parms prefixed with a "%", such as:
Code:
dnsfilter_custom1
dnsfilter_custom2
dnsfilter_custom3

Explanation of % prefix
To force a setting to always be included in the save, even if it is an empty value, prefix the setting with a % . This will force some variables which may have a valid empty setting to be saved/restored. This is only valid for individual settings and is not valid on the section header.
Code:
[System - Basic]
%time_zone_dst
time_zone
time_zone_dstoff

Type "nsrum" to access the installation menu and select option [2] Check for updates to existing installation.

Grateful to @here1310 for the feedback!
 
Status
Not open for further replies.

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