What's new
  • 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!

[Tutorial]Windows: Backup/restore ALL settings in Asus router

Poul Bak

Regular Contributor
Linux user? MOVE ON, nothing here for you to see.
Running Merlin? MOVE ON, nothing here for you to see.

So you're a Windows 11 user and you have tried backing up settings from the GUI. Now after you have factory reset the router and restored the settings you find that some settings, like server certificate and device icons, are missing and must be set up manually. You don't know (and don't want to know) Linux, which the router runs a limited version of, and you don't want to install anything.

Then this tutorial is for you.

The idea of this tutorial is to create 2 backup files. The 2 backups become a pair that should be made and used right after each other. The first backup is the standard settings backup made from the router's GUI ('Administration', 'Restore/Save/Upload Setting') The second is what this is about, which covers the rest of the settings.

The commands here use a thing called SSH, which is a kind of (secure) backdoor into the router. The good news are that Windows 11 already contains a SSH client, we can use, so nothing needs to be installed.

Prerequisites:
The only thing you need is a USB-stick mounted in the router's usb port (see 'Additional notes')

Well, here we go:

1. This is a one time SSH setup in Windows:
SSH uses a key for encrypting the connection. We need to generate that.
Run the following in Windows Terminal:
Code:
ssh-keygen -C "" -q -N ""
Press 'Enter' to accept the default filename.
You will need the public key later, which will be in:
"C:\Users\<windowsuser>\.ssh\id_ed25519.pub". (<windowsuser> is your Windows username)
It's a standard text file (can be opened in Notepad or whatever).
This key can be reused by all your routers.

2. The rest of the steps are one time steps per router:
Open the public key file, you just created, select all and copy to clipboard.
Login to the routers GUI (in browser).
Go to 'Administration', System'.
Find 'Enable SSH' and set to 'LAN only' - meaning you can only access SSH from lan.
Set 'SSH Port' to the number you want to use (do NOT use 22!)
Under 'Authorized keys', paste the key you copied earlier.
Click 'Apply' - leave the browser open.
Now your router is ready to accept connections.

Replacements used in rest of tutorial:
<router-ip> - The ip address of the router
<port> - The SSH port you entered above
<username> - Your router's login username
<routername> - just part of filename, I prefer to use the router name
<diskname> - in the GUI, go to front page, click the USB icon and click the 'Format' tab. Copy 'Diskname'

Now create the actual command files.

3. Backup command:
Open Notepad, type (and replace):
Code:
ssh-keygen -R [<router-ip>]:<port>
ssh -o StrictHostKeyChecking=accept-new -p <port> <username>@<router-ip> "cd /jffs && tar -cf /mnt/<diskname>/backup_jffs_<routername>.tar *"

pause && rem I prefer 'timeout /t 3' after testing
Save the file as 'Backup_jffs_<routername>.cmd'.

4. Restore command:
Open Notepad, type (and replace):
Code:
ssh-keygen -R [<router-ip>]:<port>
ssh -o StrictHostKeyChecking=accept-new -p <port> <username>@<router-ip> "cd /jffs && tar -xf /mnt/<diskname>/backup_jffs_<routername>.tar && reboot"

pause && rem I prefer 'timeout /t 3' after testing
Save the file as 'Restore_jffs_<routername>.cmd'.

Test the connection as shown in 'Additional notes'.
You're now ready!
How and when to perform a backup:

Always make sure you're backing up a healthy router!
Ideally, you should perform a factory reset and set it up manually before making a backup, that way your router will be healthy and free from garbage.
Now after you have set up everything (including the SSH setup shown above), you:
1. Perform a standard settings backup via the GUI ('Administration', 'Restore/Save/Upload Setting'). Copy 'Settings_<routername>.CFG' from 'Downloads' folder and save it where you like.
2. Run (doubleclick) the 'Backup_jffs_<routername>.cmd' file.

How and when to perform a restore:

Always make sure your backup is from a healthy system and not 'too old'. A backup can get 'too old' if you perform a firmware upgrade, where Asus tells you to factory reset or if you have performed several firmware upgrades. In that case you should NOT use your old backup, but rebuild the system and then make a new backup.
Again ideally when you want to restore the settings you should perform a factory reset first, that will clean all settings and leave no garbage.
After the factory reset, browse to the router's GUI, setup your username and password and then choose 'Advanced setup'. Now you can choose 'Load settings' and select your backup ('Settings_<routername>.CFG'), which will be uploaded to the router.
After the router has rebooted (be patient, it takes minutes), you can now run 'Restore_jffs_<routername>.cmd' to restore the rest of settings. Again the router reboots.
When it comes up again (again be patient), you're done and you can connect to your router normally. It will now have ALL settings from the backups.

Hope this can help someone.
 
Additional notes:

About the usb-stick:

Any usb-stick will do just fine. Just buy the cheapest you can find - physically small, so it doesn't stick out on the back of the router. Plug it into the router before setting up.
If you already have a usb-stick/usb harddisk connected to the router, you can use that (it only takes about 1 MB of space). It doesn't interfere with what is already on the drive.
Backing up will create one file at the root of the drive.
If you want to check the backup file, the easiest is to unmount it (push out) from the GUI, then insert it into your Windows pc. Double clicking the file will show the contents.
Why is it even necessary to use a usb-stick? Because the router has disabled the commands to transfer files to/from pc.
Does the usb-stick need to stay in the router? Nope, only when you actually backup/restore.
If you have more than one router, you want to backup, you can actually move the usb-stick around, just make sure the <routername> part of the filename is unique.

About security:
The commands are meant to be used only from LAN, in which case it's secure.
It's important to select 'Only LAN' when you enable SSH in the router, don't let hackers in.
If you're hysterical about security (and only then), just unplug the internet connection from the router while backing up/restoring and you'll be 100% safe.

"Ordnung muß sein":
To keep this organized I recommend creating a folder somewhere on your pc, then store both the normal settings backup ('Settings_<routername>.CFG') and the 2 backup/restore CMD files in that folder.

Testing the connection (without doing anything):
In Windows Terminal, run:
Code:
ssh -o StrictHostKeyChecking=accept-new -p <port> <username>@<router-ip>
The first time you might be asked for your router's password.
If you get a nasty WARNING about host key, run:
Code:
ssh-keygen -R [<router-ip>]:<port>
and try again.
If all goes well, you should get a prompt:
Code:
<username>@<router-ip>:/tmp/home/root#
type 'exit' and 'Enter'.
 
Last edited:

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