learningbydeveloping.com

 

Learning by developing

...because practice teaches you

To carry this process out you should have access through SSH to the router as explained in the previous post.

Note: This will reset your router to its original state(firmware). I am not responsible for any damage that this procedure can cause to your router, do it on your own risk.

You have to download from the above provided links the firmware corresponding to your router. Make sure you downloaded the correct one. Then go to a console and carry this steps out:

***************************************************************************************

1st. Copy the file to the router’s temp directory: $scp file-with-router-firmware.bin root@192.168.1.1:/tmp

2nd. Access the tmp directory: $ cd tmp

3rd. Flash the router with the firmware: $ mtd -r write file-with-router-firmware.bin firmware

Note: remember to change “file-with-router-firmware.bin” and set it to the correct firmware’s name.

***************************************************************************************

 

The sequence and output would be like:

***************************************************************************************

ubuntu@ubuntu-desktop:~/OpenWRT$scp mr3420v1_en_3_12_8_up(110418).bin root@192.168.1.1:/tmproot@192.168.1.1’s password:mr3420v1_en_3_12_8_up(110418).bin   100% 3840KB   1.9MB/s   00:02

ubuntu@ubuntu-desktop:~/OpenWRT$ssh root@192.168.1.1

root@192.168.1.1’s password:

 

 

BusyBox v1.19.3 (2012-01-08 21:07:48 MST) built-in shell (ash)

Enter ‘help’ for a list of built-in commands.

 

_______                     ________        __

|       |.—–.—–.—–.|  |  |  |.—-.|  |_

|   –   ||  _  |  -__|     ||  |  |  ||   _||   _|

|_______||   __|_____|__|__||________||__|  |____|

|__| W I R E L E S S   F R E E D O M

ATTITUDE ADJUSTMENT (bleeding edge, r29697) ———-

* 1/4 oz Vodka      Pour all ingredients into mixing

* 1/4 oz Gin        tin with ice, strain into glass.

* 1/4 oz Amaretto

* 1/4 oz Triple sec

* 1/4 oz Peach schnapps

* 1/4 oz Sour mix

* 1 splash Cranberry juice

—————————————————–

root@OpenWrt:~# cd /tmp/

root@OpenWrt:/tmp#

 

root@OpenWrt:/tmp# mtd -r write mr3420v1_en_3_12_8_up(110418).bin firmware

Unlocking firmware …

 

Writing from mr3420v1_en_3_12_8_up(110418).bin to firmware …  [w]

Rebooting …

***************************************************************************************

 

Recovering a Openwrt distribution:

 

This might not run in some cases, but it run quite often for me. If you cannot access your device at some point but Openwrt is installed you can follow the next steps in order to have access through telnet to it and being able to restore it to its initial state:

***************************************************************************************

1st. Switch the router off.

2nd. Switch it on while pressing continuously and repeatedly the quey “QSS” in the front part of the router. You should press repeatedly for some time, until the “SYS” light in the router is blinking(I wait around 2-4 seconds) very fast. Then you can stop pressing the QSS key.

3rd. Connect your Ethernet cable to the router in one of the four network connections available.

4th. Go to a console:

4.1. Check your network interfaces and take the one corresponding to the connected wire. Use “ifconfig” for this purpose. Let’s suppose the interface is called eth0.

4.2. Introduce the next command: $ sudo ifconfig eth0 192.168.1.2 netmask 255.255.255.0

4.3. You can check if the router responds by pinging it, since its default IP address is 192.168.1.1: $ping 192.168.1.1

4.4. Then access through telnet: $telnet 192.168.1.1

4.5. Restore the initial state of the Openwrt distribution: $ /sbin/firstboot

4.6. Change the password for accessing through SSH: $ passwd

4.7. Exit from the router, give it a while and reboot it. Now you should be able to access the router through $ ssh root@192.168.1.1 and it should give you IP address automatically through DHCP.

***************************************************************************************

Leave a Reply