How to back up a router?

Discussion in 'backup, imaging & disk mgmt' started by pajenn, Sep 28, 2010.

Thread Status:
Not open for further replies.
  1. pajenn

    pajenn Registered Member

    Joined:
    Oct 26, 2009
    Posts:
    930
    I want to try DD-WRT's alternative linux-based firmware for my router in place of its default D-Link firmware. What program is good for router backups/restores? Can a regular imaging software (Acronis, Drive Snapshot, or similar) be used to make a raw sector-by-sector image of the router and restoring the image if necessary (how)?
     
  2. NoIos

    NoIos Registered Member

    Joined:
    Mar 11, 2009
    Posts:
    607
    Imaging software has nothing to do with your router. They're used only to backup storage devices. Although I have never used D-Link products ( mostly Netgear ) I believe that keeping an updated firmware from D-Link's site is all you need. Also your router could have itself a function to backup your current settings (not the the router's firmware ). A warning, before changing your firmware check if the change is reversible ( which I believe it is )

    ps: check the wiki of the DD-WRT you'll find there all the answers you need. Just checked it.
     
    Last edited: Sep 28, 2010
  3. pajenn

    pajenn Registered Member

    Joined:
    Oct 26, 2009
    Posts:
    930
    ok. i just thought that if routers stored their firmware on a storage chip then maybe it would be possible to make a raw backup copy of it with some disk imaging tool, but i take it the answer is negative.

    I cannot find the firmware for D-Link's DIR-615 rev. D3 (version 4.00) on either their UK or US site:

    ftp://ftp.dlink.co.uk/dir_products/dir-615/
    ftp://ftp.dlink.com/Router/

    It does and I saved the settings, but I doubt that will do me any good if the DD-WRT firmware install goes pear-shaped.

    They say to refer to their DIR-600 guide, but warn that this method is untested with DIR-615. However, the DIR-600 guide assumes you have a copy of the original firmware available on your hard drive, and I do not since I cannot find it on D-Link's support site, and I don't know a program that can back up router firmware.

    Thanks in any case.
     
  4. NoIos

    NoIos Registered Member

    Joined:
    Mar 11, 2009
    Posts:
    607
    Best thing to do as a beginning: contact D-Link and request the firmware for your exact model.
     
  5. Searching_ _ _

    Searching_ _ _ Registered Member

    Joined:
    Jan 2, 2008
    Posts:
    1,988
    Location:
    iAnywhere
    Depends on the maker of the router how it is done.

    Enable remote access
    telnet 192.168.X.X username:password
    (type) help
    or
    (type) ?
    or
    (type) help all
    or
    (type) uname -a
    or
    other linux comnmands (ls, ps)
    Your router runs linux you just have to find out what shell it's using.

    If you succeed in getting a list of commands that you can run,
    look for commands involving flash.
    There may be multiple partitions in the flash, one will be the embedded OS and one will be the wireless firmware.
    Copy both.
    The flash in my router has 8 sections or partitions, 2 for the original software and the rest for new updates so you can roll back if an issue is encountered.
    You may have to FTP it to the desktop and visaversa to get DD-WRT onto it.
     
  6. jwcca

    jwcca Registered Member

    Joined:
    Dec 6, 2003
    Posts:
    772
    Location:
    Toronto
    I have a Cradle Point MBR1000 which has an option to Save to Local Hard Drive built in.
    It's found in Tools > System
    Not all routers may have that option.
     
  7. pajenn

    pajenn Registered Member

    Joined:
    Oct 26, 2009
    Posts:
    930
    Just to update: D-Link sent me the firmware, but it's v4.11 whereas the original firmware was v4.00. Now I'm glad to receive the latest firmware version, but my concern was that maybe it was the wrong one because with v4.00 installed, the router interface said that was the latest firmware when I clicked the 'check for firmware update' button. Anyway, I decided to risk it and updated to v4.11 manually, and now it still says I have the latest firmware installed.

    I'll see how this works before I decide whether to move on to DD-WRT's firmware because I'm concerned I may not be able to restore the router to its current state if something goes wrong with the DD-WRT option or if I just like it less.

    fwiw, my main reason to update from v4.00 was that I would lose internet access almost daily and had to reboot the router to restore it. (It's too early to say if the same will be true with v4.11).
     
  8. Searching_ _ _

    Searching_ _ _ Registered Member

    Joined:
    Jan 2, 2008
    Posts:
    1,988
    Location:
    iAnywhere
    I took some time to be more specific about accessing the router directly to back up files.
    Accessing your router to manually copy the files that allow the router to function requires some detective work for you. Routers run a smaller version of linux called an Embedded Operating System and is customized for that manufacturer and device.

    To gain access to the router:

    1. At the router web admin panel, Enable remote access.

    2. From Windows CMD, telnet into the router.
    At the command prompt (cmd.exe)
    (type) telnet <192.168.x.x>

    There will be a prompt for a username and then a password.
    (It is the same username and password you use at the Admin web panel)

    After entering that you are in.

    Now you will need to find out which shell is on the router.

    What's a shell?
    A shell is just a command line interpreter, there are many.
    • Bourne shell (sh)
    • Almquist shell (ash)
    • Bourne-Again shell (bash)
    • C-shell (csh)
    • Debian Almquist shell (dash)
    • Korn shell (ksh)
    • Z shell (zsh)
    • Busybox
    Because there are many shells available, it is important to learn to distinguish between the different shells. Typing commands for one shell when you are using another is bound to cause confusion.

    What shell does my router have?
    There are two methods to help determine available shells.

    To determine the default shell:

    (typing) echo $SHELL
    Code:
    /bin/csh
    Returned value shows the default shell to be C-shell.

    To determine the shell your in:

    (typing) ps -p $$
    Code:
    PID TTY          TIME CMD
    6453 pts/0    00:00:00 csh
    
    This is a C-shell.

    Another shell value returned:
    Code:
    PID TTY          TIME CMD
    5866 pts/0    00:00:00 bash
    
    This is a bash shell.

    Now you will need to look for applets/commands that will access the flash memory.

    After you know where the file is and its directory you can proceed to ftp from an ftp client program.

    To perform a file transfer, use the following procedure from your computer:

    Enter the command and destination address:
    ftp 192.168.x.x​
    You will receive a response similar to:
    Code:
    220-FTPSERVE at 192.168.x.x, hh:mm:ss CST day mm/dd/yy
    220 (Possibly more information about the system...)
    192.168.x.x username:
    
    At the prompt, enter your logon id on the remote host machine.
    After you enter your logon id the system will respond:
    Code:
    331 Send password, please
    192.168.x.x password:
    
    Enter the password for your account on the remote machine and the system will respond:
    Code:
    230 user_name logged in; working directory directory_name
    
    FTP commands:
    • ?
    • help
    • dir
    By default, FTP assumes the file being transferred is an ASCII file. If the file is not an ASCII file, for example, if it is an executable file, you need to tell FTP that the transfer is not ASCII.

    Embedded OS file is going to be an image type.
    At a command prompt type one:
    • binary
    • octet
    • image
    • ascii
    The FTP commands you enter affect this directory.
    To change the remote working directory, issue the command at the FTP prompt:
    • cd new_directory
    To transfer a file from your machine to the remote machine, use the put command at the FTP prompt.
    • put localfile remotefile
    To transfer a file from the remote machine to your local machine, use the get command at the FTP prompt:
    • get remotefile localfile
    When transferring files from the remote machine to the local machine, files are saved in your current directory.
    To change the directory on the local machine, enter the command, at the FTP prompt:
    • lcd local_directory_name
     
    Last edited: Oct 4, 2010
  9. pajenn

    pajenn Registered Member

    Joined:
    Oct 26, 2009
    Posts:
    930
    Thank you for the detailed response which must have taken quite a bit of effort to write up. I'll give it a go.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.