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

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

afool622

Occasional Visitor
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.
 

eibgrad

Very Senior Member
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:

RMerlin

Asuswrt-Merlin dev
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.
 

MarkyPancake

Senior Member
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.
 

afool622

Occasional Visitor
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
 

RMerlin

Asuswrt-Merlin dev
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.
 

RainGater96

Occasional Visitor
Get the nvram values for dhcp_hostnames and dhcp_staticlist and replace it as shown below:

Code:
[email protected]:/tmp/home/root# nvram get dhcp_hostnames

[email protected]:/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
 

RMerlin

Asuswrt-Merlin dev
Get the nvram values for dhcp_hostnames and dhcp_staticlist and replace it as shown below:

dhcp_hostnames doesn't exist on stock firmware.
 

RainGater96

Occasional Visitor
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.
 

ColinTaylor

Part of the Furniture
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.
 

RainGater96

Occasional Visitor
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.

 

ColinTaylor

Part of the Furniture
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.
 

RainGater96

Occasional Visitor
Is there a way to turn off the LEDs (using NVRAM) in stock firmware as it's pretty bright in RT-AC87U?
 

RainGater96

Occasional Visitor
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