What's new

Noob Question: Is there a way to save and restore configs like (device names, static ips, port forwarding) so factory resets are less inconvenient ?

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

afool622

Regular Contributor
I was thinking about doing a factory reset. I read in a thread that you can save and restore configs that wasn't through the UI. I don't remember what or how it was done. Also if tihs doesn't exist please let me know as well. This is with stock asus firmware.

Thanks in advance.
 
I don't know of a way to save them "as defined in the GUI", but when using third-party firmware (Merlin, FT (FreshTomato), dd-wrt, etc.), you can often manage such things *outside* the GUI.

For example, on my FT router, I can create port forwards using iptables (the routers' firewall) and apply them via a script when the router boots, rather than using the GUI. Functionally there is no difference. But it's a LOT easier to save and reinstall that script each time the firmware is updated then having to reapply all the port forwards using the GUI. Other items can be managed similarly (static leases, static routes, etc.).

Some users will instead save and restore the relevant nvram variables (where the router actually stores this information for the GUI) individually, thus everything remains managed by the GUI.

But regardless of the technique, it's all made possible by the fact I'm using third-party firmware. Using OEM/stock firmware, you usually don't have such options (not unless it offers shell access (e.g., ssh/telnet), which in my experience is rare). That firmware pretty much deals w/ backup and restore as a whole. As a result, that makes using those backups for firmware updates problematic. *Everything* gets updated, even those things that shouldn't be.

It's stuff like this that drives ppl's interest in third-party firmware.
 
Last edited:
The idea of doing a factory default reset is specifically to get rid of some potentially invalid settings. Restoring a copy of these settings would pretty much nullify your reset.
 
I was thinking about doing a factory reset. I read in a thread that you can save and restore configs that wasn't through the UI. I don't remember what or how it was done. Also if tihs doesn't exist please let me know as well. This is with stock asus firmware.

If you can enable SSH in stock firmware, then you can plug a USB drive into the router and export plain text lists using commands in Putty and then do the same to import them when necessary.

My router config isn't too complicated, so when I do a full reset I don't mind manually setting it up, but having the manual IP list and DNS filters as text files to import saves some time. I can't remember the commands I use though off the top of my head.
 
The idea of doing a factory default reset is specifically to get rid of some potentially invalid settings. Restoring a copy of these settings would pretty much nullify your reset.
It's mainly for static ip settings and device names I want to retain. Everything else I don't mind reconfiguring
 
It's mainly for static ip settings and device names I want to retain. Everything else I don't mind reconfiguring
You'd need to know which exact setting. Then, you can retrieve or set them over SSH. For example:

Code:
nvram get dhcp_staticlist

Will give you your DHCP reservations. Then:

Code:
nvram set dhcpi_staticlist="1>2>3>4"
nvram commit

Would let you re-set them, replacing the 1>2>3>4 with what you saw when you did the nvram get before the reset.
 
Get the nvram values for dhcp_hostnames and dhcp_staticlist and replace it as shown below:

Code:
admin@RT-AC68U:/tmp/home/root# nvram get dhcp_hostnames

admin@RT-AC68U:/tmp/home/root# nvram get dhcp_staticlist

Create a shell script, for example dhcp.sh:
#!/bin/sh

nvram set dhcp_hostnames="REPLACE WITH WHAT YOU GET FROM dhcp_hostnames"
nvram set dhcp_staticlist="REPLACE WITH WHAT YOU GET FROM dhcp_staticlist"

nvram commit
It's mainly for static ip settings and device names I want to retain. Everything else I don't mind reconfiguring
 
Get the nvram values for dhcp_hostnames and dhcp_staticlist and replace it as shown below:

dhcp_hostnames doesn't exist on stock firmware.
 
dhcp_hostnames doesn't exist on stock firmware.
Thank you @RMerlin, didn't know that it doesn't exist in stock.

1. Is there a way to turn off the LEDs in stock firmware as it's pretty bright using NVRAM? I have RT-AC87U.

2. Also, is "mtd-erase2 nvram" the correct way to clean all the NVRAM and start fresh?

How about /jffs partition? How do I clean it up as well in stock - just remove everything, "rm -rf /jffs/*"?

Since you stopped supporting RT-AC87U, I am going with the stock firmware as they are at least patching the router with security updates.

Thank you so much for all you do for various ASUS routers and much appreciate it.
 
2. Also, is "mtd-erase2 nvram" the correct way to clean all the NVRAM and start fresh?
No. The correct way is to either use the physical reset button or the GUI option (Administration > Restore/Save/Upload Setting > Factory default > Restore).

How about /jffs partition? How do I clean it up as well in stock - just remove everything, "rm -rf /jffs/*"?
No, because you will not be able to delete files that are currently being used. Use the "Initialize" check box at Administration > Restore/Save/Upload Setting > Factory default > Restore.
 
No. The correct way is to either use the physical reset button or the GUI option (Administration > Restore/Save/Upload Setting > Factory default > Restore).


No, because you will not be able to delete files that are currently being used. Use the "Initialize" check box at Administration > Restore/Save/Upload Setting > Factory default > Restore.
Thanks. I get it that you can use the Factory default from the GUI but read some posts that it's not a clean way. Maybe, ASUS has cleaned up the GUI to reset it completely.

 
Thanks. I get it that you can use the Factory default from the GUI but read some posts that it's not a clean way. Maybe, ASUS has cleaned up the GUI to reset it completely.

https://www.snbforums.com/threads/how-to-reset-nvram-on-asus-rt87u-please-help.23835/#:~:text=Factory re-set, hold reset,reset all to factory settings.
That thread is from 7 years ago. I definitely wouldn't use the mtd-erase2 command unless it was a last resort. See the quote from RMerlin here: "do not use this method unless you know what you are doing! Erasing the wrong partition can permanently brick your router!". If a normal reset doesn't work try using a hard reset. But really, a normal reset should work fine. Don't make things more complicated than they need to be.
 
Is there a way to turn off the LEDs (using NVRAM) in stock firmware as it's pretty bright in RT-AC87U?
 
Black electricians' tape. The Car Talk solution.
Well, I already applied a black tape as I couldn't take the disco lights in my bedroom. LOL.

I am looking for an elegant solution. Since @RMerlin has implemented in his firmware, I thought of patching it up if it's simple enough.
 

Similar threads

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