Factory Defaults

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:00, 11 May 2006 (edit)
169.237.154.68 (Talk)
(Via the reset button on the router)
← Previous diff
Revision as of 19:04, 11 May 2006 (edit) (undo)
169.237.154.68 (Talk)
(From the Command Line (Telnet or SSH or Web GUI))
Next diff →
Line 29: Line 29:
===From the Command Line (Telnet or SSH or Web GUI)=== ===From the Command Line (Telnet or SSH or Web GUI)===
Log into the router over SSH and run the command: Log into the router over SSH and run the command:
-<pre>Someone put command here</pre>.+ 
 +<pre>
 +mtd erase nvram;reboot
 +</pre>
 + 
You can also run this command under ''Administration -> Diagnostics'' in the DD-WRT Web GUI. You can also run this command under ''Administration -> Diagnostics'' in the DD-WRT Web GUI.

Revision as of 19:04, 11 May 2006

{Comment: Hello everyone, this is my attempt at describing the Factory Defaults info. May or may not be entirely accurate. --Jgoldberg 02:20, 2 May 2006 (CEST)}

Contents

About Factory Defaults

Every router comes from the factory with certain options set on it. These options determine operating characterstics of the router under the factory firmware. {to be elaborated, anyone?}

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.

Configuration Save/Load

{Comment: I'm not sure how accurate this part is. --Jgoldberg 02:20, 2 May 2006 (CEST)}

When you use the DD-WRT Web GUI 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.

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.

Via the DD-WRT Web GUI

Under Administration -> Factory Defaults

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 behavour here is for it to not actually clear the NVRAM. Many people think of it and phrase it that way. What is 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.

From the Command Line (Telnet or SSH or Web GUI)

Log into the router over SSH and run the command:

mtd erase nvram;reboot

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

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 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.

SCRAPBOARD

Useful link to bug 0000422 in the bugtracker that mentions "firmware upgrades are supposed to bze done thru the web interface, and, emergency tftp flashing is done using the tftpd feature built-in the CFE or PMON." by mbouissou