For this example, we will restore the Linksys WRT1900ACS to its OEM firmware. We will also be using a Windows machine but the method is equally applicable to a Linux machine.
This particular method depends on several variables:
- That you have internet service to the router, and
- That you can locate the download "link" to the router's stock OEM firmware, and
- That the OEM firmware image is not a zipped/compressed (i.e., must be an image file ready to upload and flash)
LOCATING THE DOWNLOAD LINK TO THE OEM FIRMWARE:
The first task is to locate the "actual" download link to the OEM firmware. This is the link that when clicked on, will begin downloading the OEM firmware image. Test that the link will actually start downloading the image as opposed to taking you to another webpage where a different link must be clicked on to start the download.
In this example, we will located the Linksys firmware download for the WRT1900ACS version 2 (which is the router we are working with).
In the image below, if I were to click on the "Download" link, the firmware will start downloading. Perfect. I will now copy the the actual http://..... link by right clicking the Download link and select Copy Link Location
PREPARING OUR RESTORE COMMANDS:
To make this an easy process, we will save the actual link just copied to a text document. This is allow us to prepare all the commands necessary to execute the firmware installation.
The actual link that was copied above is shown below.
Code: Select all
http://downloads.linksys.com/downloads/firmware/FW_WRT1900ACSV2_2.0.1.186724_prod.img
The first commmand we will use will fetch and download the OEM image to a temp file location on the router. The command and format will be:
Code: Select all
cd /tmp ; opkg update ; opkg install wget ; wget DOWNLOAD_LINK_LOCATION
whereas, we will substitute DOWNLOAD_LINK_LOCATION with the "actual" download link:
Code: Select all
cd /tmp ; opkg update ; opkg install wget ; wget http://downloads.linksys.com/downloads/firmware/FW_WRT1900ACSV2_2.0.1.186724_prod.img
Code: Select all
sysupgrade -F -n -v NAME_OF_FIRMWARE_IMAGE
Code: Select all
FW_WRT1900ACSV2_2.0.1.186724_prod.img
Code: Select all
sysupgrade -F -n -v FW_WRT1900ACSV2_2.0.1.186724_prod.img
Code: Select all
cd /tmp ; opkg update ; opkg install wget ; wget http://downloads.linksys.com/downloads/firmware/FW_WRT1900ACSV2_2.0.1.186724_prod.img
sysupgrade -F -n -v FW_WRT1900ACSV2_2.0.1.186724_prod.img
USING PUTTY TO ACCESS THE ROUTER
Now that we have our line commands, we will access the router using PuTTy. We will start PuTTy by clicking on the putty.exe which will bring up the login window.
In the Session category, we will enter:
- The IP address of the router (in our case, as with most, 192.168.1.1)
- The Port number 22
- Select SSH as the type
- Click on the Open button
After the connection is opened, a Security Alert Warning may pop up. If so, proceed by clicking the YES button:
The shell login widow will now appear asking for your login name and password that you currently use to access your router In most cases, unless you have changed it at some point, the login name will be "root". Enter the name and password, pressing enter after each:
After our login is accepted, we will now enter our fist command to fetch the OEM firmware:
You can watch the screen until it notes the firmware image download is 100%:
We will now enter the second command to upgrade (install) the firmware image:
You may get a warning about checking the image, but will force the upgrade nonetheless. This is common and there may be situations that require us to actually force the upgrade via command.
Watch for Upgrade Completed and click on the X to close out PuTTY while the router is rebooting:
When the router completes rebooting, you should now be able to access the router using the OEM stock router's login user name and password.
DONE!
In the second part of this tutorial, I will demonstrate how to flash the firmware WITHOUT internet service.