Sunday, October 5, 2008

Guide to flash DDWRT firmware on DIR-300

I have just done this on my DIR-300 successfully...not easy though for a beginner to start. There is some other online guidelines to teach how to flash the firmware but is not clear enough, so here comes another guideline from myself. This is just an enhancement of this to make everything more clear.

Things to be download before start:

  1. Telnet Client(Putty) Download Link :Putty Usage :To communicate within PC and Router
  2. TFTP Server(PumpKin) Download Link :PumpKin Usage: To load all the files that need to be transfer from PC to Router
  3. ap61.ram Download Link:DD-WRT (/v24/Atheros WiSoc/D-Link DIR300/ap61.ram)*ftp download
  4. ap61.rom Download Link:DD-WRT (/v24/Atheros WiSoc/D-Link DIR300/ap61.rom)*ftp download
  5. linux.bin Download Link:DD-WRT (/v24/Atheros WiSoc/D-Link DIR300/linux.bin)*ftp download

Start Flashing

  1. Install Pumpkin onto your PC.
  2. In the Pumpkin program, click option and set path to the directory that locates all the files(linix.bin , ap61.rom and ap61.ram)
  3. Connect the network cable from pc ethernet port to the WAN port of DIR-300.
  4. Configure PC static IP to be 192.168.20.80/255.255.255.0.
  5. Hold on to the reset behind the DIR-300.
  6. Power on the DIR-300 while holding on to the reset button. Hold the reset button for 30 seconds while it is booting.
  7. Release the reset button
  8. Telnet to 192.168.20.81 on port 9000
  9. You should be greeted by the RedBoot prompt. RedBoot> (Need to wait some times)

Loading in the temp boot loader

RedBoot> load ap61.ram
Using default protocol (TFTP)
Entry point: 0×800410bc, address range: 0×80041000-0×800680d8
RedBoot> go

It is normal to be disconnected from the telnet session.
Note: Do not reboot the router.

Loading a new boot loader
Before proceeding, set your system IP to 192.168.1.2/255.255.255.0 and then telnet to the new address 192.168.1.1, port 9000.

Note: You may need to connect the ethernet cable to the LAN port instead of WAN port.

After you are connected, follow the steps below

DD-WRT> fconfig -i
Initialize non-volatile configuration - continue (y/n)? y
Run script at boot: false
Use BOOTP for network configuration: true
Default server IP address:
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×80ff0000-0×81000000 at 0xbffe0000: .
DD-WRT> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×807f0000-0×80800000 at 0xbffe0000: .

DD-WRT> ip_address -h 192.168.1.2
Default server: 192.168.1.23

DD-WRT> load -r -b %{FREEMEMLO} ap61.rom
Using default protocol (TFTP)
Raw file loaded 0×80080000-0×800a8717, assumed entry at 0×80080000

DD-WRT> fis create -l 0×30000 -e 0xbfc00000 RedBoot
An image named ‘RedBoot’ exists - continue (y/n)? y
… Erase from 0xbfc00000-0xbfc30000: …
… Program from 0×80080000-0×800a8718 at 0xbfc00000: …
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×807f0000-0×80800000 at 0xbffe0000: .
DD-WRT> reset

Your DIR-300 will reset at this point. Telnet to it (192.168.1.1, port 9000) after it has finish resetting. (approximately 30+ seconds)

Configuring the Putty Client

  1. Right-click on PuTTY Client’s title bar
  2. Select “Change Settings…”
  3. On the “PuTTY Reconfiguration” window, change close window on exit to Never
  4. Click on the Apply button

Loading in the new firmware
It is important that you don’t disconnect the power or ethernet cable for this section. Those fis create commands take quite some time to complete, so do be patient and don’t interrupt the process.

DD-WRT> ip_address -h 192.168.1.2
IP: 192.168.1.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.2
DD-WRT> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
… Erase from 0xbfc30000-0xbffe0000: …………………………………………………..
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×80ff0000-0×81000000 at 0xbffe0000: .
DD-WRT> load -r -b 0×80041000 linux.bin
Using default protocol (TFTP)
Raw file loaded 0×80041000-0×803cffff, assumed entry at 0×80041000
DD-WRT> fis create linux
… Erase from 0xbfc30000-0xbffbf000: …………………………………………………
… Program from 0×80041000-0×803d0000 at 0xbfc30000: …………………………………………………
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×80ff0000-0×81000000 at 0xbffe0000: .
DD-WRT> fconfig boot_script true
boot_script: Setting to true
Update RedBoot non-volatile configuration - continue (y/n)? y
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×80ff0000-0×81000000 at 0xbffe0000: .
DD-WRT> fconfig boot_script_timeout 3
boot_script_timeout: Setting to 3
Update RedBoot non-volatile configuration - continue (y/n)? y
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×80ff0000-0×81000000 at 0xbffe0000: .
DD-WRT> fconfig bootp false
bootp: Setting to false
Update RedBoot non-volatile configuration - continue (y/n)? y
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×80ff0000-0×81000000 at 0xbffe0000: .
DD-WRT> fconfig
Run script at boot: true
Boot script:
.. fis load -l vmlinux.bin.l7
.. exec
Enter script, terminate with empty line
>> fis load -l linux
>> exec
>>
Boot script timeout (1000ms resolution): 3
Use BOOTP for network configuration: false
Default server IP address:
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×80ff0000-0×81000000 at 0xbffe0000: .
DD-WRT> reset

The default username and password are “root” and “admin” (without the quotes) respectively. Enjoy your new DIR-300!




Hope it Helps....Happy Flashing




My comments on this firmware:

  • Nice GUI
  • Great features
  • better routing than original firmware
  • although able to increase the TX power on the firmware but no effect at all after increasing, and it is still 17db on the status tab on the GUI. Pratically try it out and confirm no effect on changing the TX power on the firmware.
Will be update more comments as in realization .

3 comments:

junc said...

i did everything up to the first reset then nothings happen. Only power indicator from my router is up, i've waited for almost 3hours and still the same

Unknown said...

Very good steps. The pumpkin software was really a eyeopener as other tutorials assume that the user is aware of these software.
The steps are still valid and working after 4 years. Thanks

Guillaume said...

I used your tutorial today for an old router I found in the trash, now upcycled as a repeater.

Just one issue : the commands can't be copy / pasted from this page because of the "x" in the hexadecimal numbers on 2 of these commands.