Monday, January 14, 2008

WRTG 54GL - DD-WRT - Reset Factory Default by SSH

yesterday i did some misconfiguration with my DD-WRT (dev-NET erte-erwe), ipact I cannot access trough web or LAN port or event wireless client.

- cannot ping (both wireless/LAN)

- cannot access ssh

- cannot access webadmin

- internet is OK (i can surfing)

unfortunately the AP was paced in tower, its dificult to reach again. finaly i googing and found this article. howto reset by ssh.luckily i can access it from remote machine over Internet, so by SSH to this dd-wrt i run this command

laptop ~~~X~~~>AP (wds dev-NET erte-erwe) -----OK---->AP1

laptop -------X--------> LAN (dev-NET erte-erwe)-----OK--------->AP1

reset procedure

Laptop ---------> {internet }------> router (dev-NET internet)------> Proxy ------> AP1 -OK---->AP (wds dev-NET erte-erwe)

DD-WRT v24 std (c) 2007 NewMedia-NET GmbHRelease: 12/26/07 (SVN revision: 8687)
root@'s password:

____ ___ __ ______ _____ ____ _ _
| _ \| _ \ \ \ / / _ \_ _| __ _|___ \| || |
|| | || ||____\ \ /\ / /| |_) || | \ \ / / __) | || |_
||_| ||_||_____\ V V / | _ < | | \ V / / __/|__ _|
|___/|___/ \_/\_/ |_| \_\|_| \_/ |_____| |_|

DD-WRT v24


BusyBox v1.4.2 (2007-12-26 01:05:19 CET) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@erte-erwe:~# mtd erase nvram;reboot
Unlocking nvram ...
Erasing nvram ...

have a nice experinece with dd-WRT


Factory Defaults

From DD-WRT Wiki

Jump to: navigation, search

Every router comes from the factory with certain options set on it. These options determine operating characterstics of the router under the factory firmware. See also Reset And Reboot for additional info on this topic (merge needed).



[edit] NVRAM

Merge needed with Hardware#NVRAM. 

Every router has a memory chip inside that stores persistent settings between reboots. The NVRAM is also retained between flashes of different firmware versions or even different firmwares!

It is necessary to reset the NVRAM between flashes so that the new firmware encounters known values in the NVRAM.

For example, let's say that Firmware A sets the imaginary variable run_masq to "/usr/bin/masqrun", and this command is run at startup. Now, let's flash the router with Firmware B, which reads the run_masq variable determine whether the router does masquerading. Firmware B expects a boolean value here, such as "1" or "0". In the best case scenario, Firmware B will just throw an error and gracefully continue booting, but there could be cases where it errors out so badly that it bricks the router or makes it unbootable.

[edit] Configuration Save/Load

When you use the DD-WRT Web GUI to save your settings to a file, you are dumping the NVRAM settings to a binary file. Because of this, you should only use this feature to restore settings on the same router with the same firmware version. Again, do not restore setting backups from previous versions as mentioned in the forum.

[edit] Resetting to Factory Defaults

NOTE: This will not restore firmware to a previous state, it only clears the settings. Here are the ways that you can Reset to Factory Defaults.

[edit] Via the DD-WRT Web GUI

Under Administration -> Factory Defaults

[edit] Via the reset button on the router

Press and hold the button while the router is on, and keep holding it about 30 seconds. On different models you may see rapid flashing of a LED, or a red error or diagnostic LED. Wait for it to return to normal operation (typically power-LED on solid). Normal behavior here is for it to not actually clear the NVRAM. Many people think of it and phrase it that way. What it is supposed to do is return all settings to factory state. If you added new non-factory variables, they should still be there after this type of reset.

Holding down the reset-button while plugging in the router achieves a different goal. Here the bootloader is in charge, so getting it to clear the memory for you may have different results. Some platforms will completely empty the NVRAM and depend on another stage of the bootloader or firmware to repopulate it. On some less-supported hardware this may have unpleasant results.

[edit] From the Command Line (Telnet or SSH or Web GUI)

Log into the router over SSH and run the command:

mtd erase nvram;reboot

Note that some versions of DD-WRT may be missing the reboot command.

You can also run this command under Administration -> Diagnostics in the DD-WRT Web GUI.

[edit] Messing with the Router Insides

There are ways to physically short certain pins/traces inside the router in order to reset the NVRAM. VERY DANGEROUS! You can physically damage the flash memory chip and TRULY "brick" an otherwise working piece of hardware this way. Every other avenue of unbricking should be tried multiple times before resorting to this.