**DISCLAIMER**The following instructions are provided without warranty of any kind. Flashing firmware does not come without risk. I will not be held responsible for any resulting equipment failure or otherwise undesirable results. Proceed at your own risk.
This tutorial explains how I successfully re-flashed my Linksys WRT54GL version 1.1 to use the Tomato 1.22 firmware rather than DD-WRT version 23 SP2 VPN firmware (generic) I have been using for the past couple of years. I decided to write this tutorial because lots of sites have instructions on flashing from the default Linksys firmware to Tomato but far fewer sites offer lots of detail on how to flash from other firmware such as DD-WRT.
I have provided directions with enough detail for the non-technical user to feel comfortable with the procedure. To make things faster for the technical users, I have highlighted the major steps. At the bottom of the post, I’ve included links to related articles I’ve published if you’d like to learn more.
As a bit of background information, I’m used a fully patched (as of November, 2008) Windows Vista Ultimate 64-bit with Service Pack 1 (SP1) Operating System and up-to-date Firefox 3 during the firmware upgrade process. The OS and web browser shouldn’t matter that much, but I thought I share in case you were worried about such things.
Before you begin, download the latest version of the Tomato firmware that is suited for most routers. This tutorial walks through flashing to version 1.22. The files are zipped in the great, but uncommon, 7zip format so you’ll need 7zip or another program that supports the 7zip format to unzip the files. The zip package contains several files, you will only need the “WRT54G_WRT54GL.bin” file but it is a good idea to checkout the “readme.”
I recommend verifying the MD5SUM hash of the “WRT54G_WRT54GL.bin” file to ensure the download wasn’t corrupt or hasn’t been comprised. If you don’t already have a tool to calculate MD5SUMs, I recommend using HashCalc although you must manually compare the sums with this tool unlike some other tools. Unfortunately, Polarcloud does not provide the MD5SUM of the download on their site but luckily for you, I calculated the hash of my download. The signature of the file should be 866251021d42608c69bff558115f95f8.
I recommend printing (or at least saving, not bookmarking, to your hard drive) the following web pages for reference since you will not have Internet access during this process:
- How to Change Your WRT54GL Firmware from DD-WRT to Tomato
- Tomato FAQ
- Tomato Firmware Wikibook
- Reset and Reboot
- Recover from a Bad Flash
It is best to turn off your firewall and anti-virus during this process to ensure that nothing interrupts the firmware flash. An interruption could cause the flash to fail and brick your router. If something does go wrong you may be able to recover from a bad flash.
You should ONLY perform the flash through an Ethernet cable using standard http (not https). Do not do this wirelessly (its best to temporarily disable the wireless adapter on your computer). If your super paranoid or live in an area with unreliable electricity, you should plug your router an PC into an uninterruptible power supply because a power failure during a firmware flash could brick your router. Plug the blue Ethernet (Cat5/RJ45) cable that came with your router into the Network Interface Card (NIC) on the back of your computer and into one of the ports labeled 1, 2, 3, or 4. The “Internet” port on your router should be connected to your broadband source (e.g., cable or DSL modem). Please ignore the extra cable in the picture. It is not needed for the flash to work.
I recommend reviewing all of your DD-WRT settings so you can quickly configure the Tomato firmware to offer similar functionality. I took screenshots of all of the pages where I had non-default settings. I also used the same security settings, including WPA2 password, after I loaded Tomato so that all of my wireless devices would not have to be updated. However, if you have poor wireless security, after flashing to Tomato is the perfect time to implement stronger security. You can reference my Securing Your Wireless Network article if you want to learn how to have a really secure wireless network.
In addition to the screenshots of your settings, it is also a good idea to perform a backup of your DD-WRT configuration. Please note you can only restore this backup on the same model router and firmware with which the backup was made. To perform a backup, go to the “Administration” tab and then the “Backup” sub-tab. Once there, just click the “Backup” button and save the file.
The last item that needs to be completed before uploading the new firmware is to reset your DD-WRT firmware to the default settings. A few ways to do this exist. I chose to use the standard web interface because it is easy and should always work. Nonetheless, pressing and holding the reset button on the back of your router for 30 seconds should also work (assuming you have not disabled that feature in your custom firmware).
To reset the router to firmware defaults, go to the internal IP address of your router (most likely 192.168.1.1) and login with the user name and password you setup when you first installed the router (if you have trouble with the login use the reset button method). Once logged in, go to “Administration” tab and the “Factory Defaults” sub-tab. I forgot to write down the exact buttons and also forgot to take a screenshot of this step but I think you just select the “Yes” radio button next to “Restore Factory Defaults” then select “Save Settings.” If that’s not it exactly, you shouldn’t have any trouble determining what to select. Be patient and don’t touch anything because the reset could take a couple of minutes.
The Tomato FAQ recommends that you Telnet into your router before performing the flash and type the “nvram get http_passwd” command to obtain the password that will be used by Tomato after the flash. You cannot just use the DD-WRT password because of a change in the way DD-WRT uses the standard http_passwd variable. I must admit that I did this step but the password I obtained during the Telnet session did not allow me to login. However, as I was writing this tutorial, it occurred to me that I may have obtained the password via Telnet before I reset DD-WRT to the default settings which may explain why the password I obtained did not work.
In order to Telnet into your DD-WRT router, open up the run box by hitting the “Window” key and “R”. Next type “cmd” and hit “Ok.” In the command window, type “telnet 192.168.1.1″ where 192.168.1.1 represents the IP address of your router. You will be prompted for a user name and password. The telnet user name is always root even if you login to the web interface with a different user name. The password should be the default DD-WRT password of “admin” since you just performed a reset. If not, try your old web login password.
Just so you know, Telnet is not enabled in Windows Vista by default but is in XP. To enable Telnet in Vista follow the instructions at Tech-Recipes site. Alternatively, you could use a tool like Putty.
The screenshot above shows the password command being typed into a Telnet session; it does not show the output of the command (i.e., my password).
Write down the password provided because you will need it later.
The next few steps is where the magic starts to happen. Go back to the DD-WRT web interface. You may have to renew the DHCP lease and login again. Since you have reset the firmware to default settings, the user name and password is now “root” and “admin”, respectively. Once logged in, navigate to the “Administration” tab and the “Firmware Upgrade” sub-tab.
Next, select the “Browse” button and select the “WRT54G_WRT54GL.bin” file you downloaded early. Once located, select the “Open” button and then the “Upgrade” button. Wait patiently for the upload to complete. Whatever you do, DO NOT interrupt it.
After a couple of minutes, you should see a screen that says “Upgrade successful. Unit is rebooting now. Please wait a moment…”
Once the reboot completes, you will be prompted to login to the Tomato firmware. This is where you use the “root” user name and the password you obtained via Telnet. Don’t worry if you can’t login…the same thing happened to me. The next paragraph has a solution for you.
Since the Tomato interface did not accept the password I obtained through the Telnet session before the flash, I had to perform a hard reset. To do this you need to hold the reset button on the back of the router while unplugging the router. Continue to hold the reset button as you re-plug in the router. Once the router is plugged in you should continue holding the reset button for 30 seconds to complete the hard reset.
After the hard reset is complete, go back to Firefox and navigate to http://192.168.1.1. At the prompt enter in “root” for the user name and “admin” as the password. The Tomato web interface should come up.
Once you’ve logged in, you should see the new Tomato firmware. Since you are upgrading from DD-WRT, the Tomato FAQ recommends performing a full reset by navigating to the “Administration” section and then the “Configuration” sub-section. From there, select “Erase all data in NVRAM memory (thorough)” from under the “Restore Default Configuration” menu and then hit “OK.” If you had to do a hard reset in order to get your login to work, you’re probably could skip this step but it won’t hurt to do an additional reset just to be safe.
After restoring the default configuration, you need to log back in using with the user name of “root” and password of “admin”. Once logged in, hit the “Renew” button that is on the “Overview” page.
After renewing you may need to reboot your computer to get Internet access. Alternatively, in Vista you may type “Network and Sharing Center” in the Start Search box. Within the Network and Sharing Center select the red “X” between the network on Internet on the map. The Windows Network Diagnostics menu should appear. On that menu select “Reset the network adapter…” option at the bottom. Windows will repair the network and you should see a message that says “the problem has been resolved.”
Now that everything is working, don’t forget to turn your anti-virus and firewall back on. Also, be sure to check out my Securing Your Wireless Network article if you want to learn how to have a really secure wireless network.
Congratulations, you’ve successfully flashed your router! Since you’ve successfully flashed your WRT54G, you may be interested in Wireless Hacks: Tips & Tools for Building, Extending, and Securing Your Network.