D-Link DIR-400 to dd-wrt firmware

D-Link DIR-400 Wireless G Router image
Price range: R727.00 - R859.00





* Wireless Internet Gateway + 4-Port Switch (801.11g)
* 801.11g High Speed Cable / DSL Router with 4-port Switch (New Generation)
* Up to 108 Mbps data transfer rate, Compatible with 802.11b
* Support VPN, NAT, DMZ, Virtual Server
* 128-bit WEP Encryption Security
* Web-based Management
* Manual on CD + Quick Installation Guide + Power Supply?

How to flash / upgrade dir-400 to DD-WRT firmware
Mini Flashing Guide for DIR-400

Required

1. linux.bin from DD-WRT’s download page for DIR-400
2. TFTP Server up and running, ready to serve the required files, e.g. PumpKIN
3. Putty (telnet client) - Chosen because it helps you to Ctrl + C

Connecting up the devices

1. Connect an ethernet cable between your computer and DIR-400’s WAN port
2. Set your computer’s IP to 192.168.0.2 and subnet mask to 255.255.255.0

Finding out when to telnet

Unlike the DIR-300, there are not bypass method of getting into RedBoot. The old trick of holding on to the reset button simply gives you the emergency web and not telnet access. We would need to find out roughly when should we telnet to the DIR-400 as the window of opportunity is as little as two seconds.

1. Open up your command prompt
2. Issue a continuous ping to the DIR-400
ping -t 192.168.0.1
3. Power on the DIR-400
4. Find out the amount of time it takes to give you the first successful reply

The are no surefire way of getting into the RedBoot. My set took maybe around 10 seconds. Do take note that I did not use a timer, I simply counted it.

Getting into RedBoot

With the previous experiment, we are now ready to telnet into DIR-400. The process is simple:

* Power on the DIR-400
* Telnet in at around the time it gives you the ping reply

You might want to open a few Putty instances so that you can connect them one after another and see which one of them got into RedBoot. Once you get into RedBoot, you should see something like below

== Executing boot script in 0.130 seconds - enter ^C to abort
^C
RedBoot>

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 DD-WRT

This is the section where we start flashing the firmware of DIR-400 to DD-WRT. It is important to remember the the commands may take some time to complete (as much as 5 minutes). Therefore, NEVER power off the device when you are doing “fis create”.

== Executing boot script in 0.130 seconds - enter ^C to abort
^C
RedBoot> ip_address -l 192.168.0.1/24 -h 192.168.0.2
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
And a descriptor for the configuration data size = 10000
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×80ff0000-0×81000000 at 0xbffe0000: .
RedBoot> load -r -b 0x80041000 linux.bin
Using default protocol (TFTP)
Raw file loaded 0×80041000-0×803cffff, assumed entry at 0×80041000
RedBoot> fis create linux
… Erase from 0xbfc40000-0xbffcf000: …………………………………………………
… Program from 0×80041000-0×803d0000 at 0xbfc40000: …………………………………………………
prog_ok
flash_addr = 0xbfc40000
mem_addr = 0×80041000
entry_addr = 0×80041000
length = 0×38f000
img_size = 0×38f000
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0×80ff0000-0×81000000 at 0xbffe0000: .
RedBoot> fconfig
Run script at boot: true
Boot script:
.. fis load -l vmlinux.bin.l7
.. go
Enter script, terminate with empty line
>> fis load -l linux
>> exec
>>
Boot script timeout (1000ms resolution): 2
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.0.1
Local IP address mask:
Default server IP address: 192.168.0.100
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: .
RedBoot> reset

Now is Finish >>>