How to Flash a Dlink DIR-300 with DD-WRT

Requirements:
1. Download ap61.ram, ap61.rom, root.fs and vmlinux.bin.l7 from DD-WRT v24 RC5 package
2. Putty 0.60
4. Patch cable
5. Workstation
Steps:
1. Connect patch cable from your workstation to Dlink’s WAN port
2. Set your workstation’s IP address to 192.168.20.80 with netmask 255.255.255.0. Plug off Dlink’s power cord and replug it
3. Open putty and set a profile to connect thru telnet port 9000 and IP address 192.168.20.81. If you don’t see the “Redboot>” prompt, hold reset button at the back for about 30 seconds, plug off Dlink’s power and reconnect again. Do this until you see the “Redboot>” prompt since the port/IP is only available for one second after bootup. Hit Ctrl+C the moment you see Executing boot script
Tip: Start a continous ping to 192.168.20.81, the second you get a reply, hit putty’s OPEN button
4. Start the tftp server on the workstation and place ap61.ram, ap61.rom, root.fs and vmlinux.bin.l7
5. Back at Redboot> prompt type:
load ap61.ram
go
A temporary boot loader should start. You will notice at your workstation that the network interface is disconnected.
6. Change your workstation’s IP address to 192.168.1.23 with netmask 255.255.255.0
7. Reconnect to Dlink with IP address 192.168.1.1 thru telnet port 9000. You should now see the “DD-WRT>” prompt
8. Type:
fconfig -i
Answer all questions with default settings and save the config.
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: .
9. Type:
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: .
10. Type:
ip_address -l 192.168.1.1 -h 192.168.1.23
11. Type:
load -r -b %{FREEMEMLO} ap61.rom
Using default protocol (TFTP)
Raw file loaded 0×80080000-0×800a8717, assumed entry at 0×80080000
Note: If you get disconnected from Dlink, reconnect and type:
ip_address -l 192.168.1.1 -h 192.168.1.23
12. Type:
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: .
Note: This process may type about 1 to 2 minutes. Be patient and don’t disconnect. Ping reply may timeout. If you get disconnected reconnect and type:
ip_address -l 192.168.1.1 -h 192.168.1.23
13. Type:
reset
The unit will reboot and the new boot loader will be executed and is waiting for your connection. Reconnect thru telnet port 9000 to IP address 192.168.1.1
14. Type the following: (fis create may take several minutes to finish)
load -r -b 0×80041000 root.fs
fis create -b 0×80041000 -f 0xbfc30000 -l 0×002C0000 -e 0×00000000 rootfs
load -r -b 0×80041000 vmlinux.bin.l7
fis create -r 0×80041000 -e 0×80041000 -l 0×000E0000 vmlinux.bin.l7
fis create -f 0xbffD0000 -l 0×00010000 -n nvramfconfig boot_script true
fconfig boot_script_timeout 3
15. Type:
fconfig
Configure the bootscript to:
fis load -l vmlinux.bin.l7
exec
16. Type:
reset
The unit should now boot DD-WRT. Bootup may take around 2 mins so be patient. Point your browser to http://192.168.1.1 to open the web interface. Default username/password is root/admin
If you some reason you want to revert to the original Dlink firmware, here are the instructions.