Cloning Router Safely?

Discussion in 'Tomato Firmware' started by Planiwa, Jul 8, 2009.

  1. Planiwa

    Planiwa Network Guru Member

    So, if I use Administration>Configuration Backup from an old (and dying) router (WRT54G V2)...
    and then Restore to a new (replacement) router (WRT54GL) ...

    What will it do with hardware-intrinsic data, such as the MAC addresses?
    Will it brick the new router?

    Or is there a better way?

    One more Clone Attempt:
    Old Mind into New Body.
    Yet another Brick?​
  2. thor2002ro

    thor2002ro Addicted to LI Member

    the config from a diffrent router will brick even if it is the same model

    write all the data in a txt thats how i do it
  3. gawd0wns

    gawd0wns Network Guru Member

    Your router will more than likely be bricked unless it is the exact same model with the same firmware version.

    What do you mean by clone? Do you wish to replicate the old router's MAC address on the new one? If you download and flash tomato onto your router (if it is a supported model), you can accomplish this in "Advanced --> MAC address". All you have to do is input the new MAC address and hit save.

    If you want to transfer settings in Tomato, such as Static DHCP settings, you will have to enter them manually. I agree with thor2002ro, copy all your settings into a text file and then just paste it after you flash the new firmware (exactly how I do it). Then you can just save the text file and a backup of the firmware so you will always have it.
  4. thor2002ro

    thor2002ro Addicted to LI Member

    need to corect you even if its the same model and fw IT WILL BRICK
  5. Planiwa

    Planiwa Network Guru Member

    Thanks for the responses. But the fact that no one has framed their answers in Haikus tells me that no one understands the problem. :biggrin:
    Clearly, someone who suggests backing up configurations as text files and pasting, is not using QoS. :smile:
    What good is a GUI config backup, when the GUI config restore destroys the computer? :frown:

    Perhaps I'll try this:

    1. backup the old router, unzip it.
    2. backup the new router, unzip it.
    3. carefully edit the new router's backup with data from the old router
    4. zip up the edited new router backup
    5. restore new router config from modified new router backup.

    Anyone done that?

    Backup, then Restore:
    Recovery Disaster!
  6. TVTV

    TVTV LI Guru Member

    Just make screenshots of the QOS/config pages then use those to add all the rules back to the new router. Easy as 3.1415.
  7. Planiwa

    Planiwa Network Guru Member

    Yup. Like doing backups by printing out files and retyping as recovery. :) :)

    Ironically, in this case, it's actually faster, cheaper, and safer than the "smart" way. :) :)

    BTW, 3.1416 is more accurate at the same precision. :biggrin:
  8. Toastman

    Toastman Super Moderator Staff Member Member

    I understand Planiwa perfectly. It takes hours to re-enter large configuration setups with many users on static DHCP, access restrictions, and full QOS rules. This is why so many people keep posting the same question about erasing NVRAM after an upgrade I guess.

    In theory it should be possible to edit the file to upload to a new router, there is a thread on here somewhere in which fyellin and I tried it, with the bricked router result. that was the third time I have tried to do this and failed, but since this is the first and only router I've ever bricked, I'm loath to try again. The problem is we don't know what to edit, what to leave in or take out.

    It occurs to me that it might be possible (maybe even very easy?) to do it by using JTAG to clone the whole thing.

    Anyone used to using JTAG care to comment??
  9. fyellin

    fyellin LI Guru Member

    After the failed experiment with toastman, the best solution I've found is to use "scrapbook" in firefox. I have a directory containing a local copy of every configuration page on my router.

    When configuring a new device, I can easily cut and paste from the scrapbook. I do have to set through a dozen 10sec or 20sec pauses while Tomato restarts some service. But it's certainly better than bricking.
  10. rizsher

    rizsher Network Guru Member

    Will this work:

    Open all the config pages you think you'd need to enter again in tabs in your browser (IE/Firefox/Chrome)....

    Upgrade the router to the new version... or, put the router you need cloned in place of the original, on the same IP/subnet etc..

    Recursively go thru each of the tabs opened with the original router's configuration and click submit.

    I'm able to do this on Linksys SPA ATAs... just wondering if it'll work on Tomato.
  11. fyellin

    fyellin LI Guru Member

    This will probably require a little bit more hacking on Tomato. The tomato web servers creates a random 64-bit token the first time it is started. Via JS magic, this token must be part of every subsequent request sent to the server.

    Your original pages will have the wrong id. Perhaps the user can ssh/telnet into the new box and set its token to be the same as the token of the original box. There may be additional problems as well.
  12. Toastman

    Toastman Super Moderator Staff Member Member

    I think the answer is to do something about removing the HTTP token function from the firmware. This would make it possible to upload saved web configuration pages to any tomato using the same IP no. by clicking "submit" as rizsher points out. There are other possiblities also such as a text entry box to change the token ID. Or ignore it/accept any token. Or use a default (a backdoor).

    Before taking this any further, has anyone tried this approach of changing the ID in NVRAM and then submitting a page? Are there any implications before doing so that would be irreversible without JTAG?

    nvram set http_id=TIDff0bc44a2622a15a should change the ID.

    rizsher, you're used to doing it with another piece of hardware, what's your opinion ?
  13. fyellin

    fyellin LI Guru Member

    Only JonZ knows the real purpose of this token.

    My main point is that off the top of my head, I could come up with at least one reason the given scheme wouldn't work. Of course it's easily gotten around by setting the http_id. I just have no idea if there are other equally obscure impediments, or if there is the possiblity of brickage.
  14. galileo2000

    galileo2000 Network Guru Member

    I really think this thread should make a sticky.

    Little bit too easy to brick the router and then blame the unjust world.

    Would be a nice feature if it could be implemented safely.

    IMO, backup could have some options, such as "Core Router Backup", "Static DHCP Info backup", "Port forwarding backup" and so on.
  15. Planiwa

    Planiwa Network Guru Member


    There is only one reason to back up configuration, and that is to TRANSFER PORTABLE configuration parameters from one platform to another (which could be the same, at a different point in time). No one would want to transfer nonportable data! The most obvious reason for backups is disaster recovery. As things are, we have a time bomb that spells recovery disaster.

    A: "The router got struck by lighning and is fried."
    B: "Fortunately, our system is well-managed, and we have a recent configuration backup"
    C. "So, we now have a new router. All we have to do is restore the backed-up configuration"
    D: "* * * What happened? The new router has become totally unresponsive?!!!"

    . . .

    Back up, then restore:
    Recovery Disaster!
    Good Idea? Not!
  16. Toastman

    Toastman Super Moderator Staff Member Member

    I often want to clone a router configuration to install in another building, the only difference would be the router ID, AP SSID, etc. I really get damned annoyed that I have to sit here keying in this stuff for hours. Time is money. Manual copying = mistakes. It would not matter to me if the whole thing including MAC address were copied.
  17. fyellin

    fyellin LI Guru Member

    Life would be simpler if there were an easy way to tell Tomato variables in nvram from those set by the hardware. Unfortunately, I don't know of any list of "here are all the variables set by tomato and the various mods of tomato".

    Creating a .cfg file is easy. Creating a .cfg file that contains exactly what you want and no more is much harder. Creating a .cfg file that contains exactly what you want and no more and doesn't brick the router, maybe some day.
  18. luckman212

    luckman212 LI Guru Member

    bump. this is so important. backup should be able to create portable configs. i wasted 3-4 hours today futzing with configs just trying to migrate 3 buffalo routers to linksys GLs. ugggh........... :mad:
  19. phuque99

    phuque99 LI Guru Member

    Let me tell you another reason:

    1. Setup router with perfect working configuration
    2. Six months down the road, decided to mess with experimental stuff
    3. Configuration screwed up, wife cannot connect on wifi and starts yelling
    4. *poof* restore backup configuration saved from step #1

    There are permutations and many other variation for step 2 onwards but that's basically what it is used for.
  20. asammar

    asammar Network Guru Member

    Just faced the same problem a few minutes ago and came to check for a solution. Apparently I am not alone! Thinking about this a bit more: don't all settings eventually make it to some sort of file on the router's file system somewhere? Can we just upload these files (in the correct format as needed) to the new router?
  21. fyellin

    fyellin LI Guru Member

    I think you've got cause and effect backwards.

    The NVRAM settings are used to create the settings files at startup. These files are re-created from scratch on every reboot. So simply copying the files does you no good.
  22. asammar

    asammar Network Guru Member

    Thanks for the clarification. Would it work then to set the more complex nvram keys in a telnet/ssh session (e.g. static DHCP) and then do the easy ones through the GUI?
  23. asammar

    asammar Network Guru Member

    Well, I just tried it and it seems to work. What I did is save the nvram dump from the debugging window on the old router. I then connected to the new router using putty and created a small script in /tmp with a few "nvram set" commands followed by an "nvram commit" command. The values for the settings were copy-paste from the dump file. I restarted the router and the settings I wanted are all there in the GUI.

    While by no means the ideal solution, it might help someone save some time in migrating settings.
  24. asammar

    asammar Network Guru Member

    One point I forgot to mention: to be safe put the values of the settings between double quotes. This way the OS will not attempt to interpret any special characters that might be in there. Also, while I did not explicitly mention it in my previous post, you do need to execute the script after you create it ;-)
  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.
    Dismiss Notice