Mini Flashing Guide for DIR-400
Required
- linux.bin from DD-WRT’s download page for DIR-400
- TFTP Server up and running, ready to serve the required files, e.g. PumpKIN
- Putty (telnet client) - Chosen because it helps you to Ctrl + C
Connecting up the devices
- Connect an ethernet cable between your computer and DIR-400’s WAN port
- 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.
- Open up your command prompt
- Issue a continuous ping to the DIR-400
ping -t 192.168.0.1 - Power on the DIR-400
- 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
- Right-click on PuTTY Client’s title bar
- Select “Change Settings…”
- On the “PuTTY Reconfiguration” window, change close window on exit to Never
- 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
Enjoy your new DIR-400!
[...] you are using DIR-400, check out Mini Flashing Guide for DIR-400 [...]
Hi,
Quite honestly I am very new to DD-WRT and caught up in an area that most ISPs have blocked VoIP applications. I have a vonage service (D-Link VTA-VC) which I need to find a way to by-pass the filtering. I have manged to secure a VPN service on a server somewhere on Internet. Now I need to have a router which can act as VPN client on its WAN port. I have been advised DD-WRT flashed router does this task perfectly. Unfortunately there is not too much choice wireless router in my area supported by DD-WRT. What I have found so far is Linksys WRT54GS v7.0 which has only 2MB flash and can only carry micro version of DDWRT which does not have VPN support. My only other option is D-Link DI-400 which I found it on an affordable price on local market. But when I look at compatibility list of DD-WRT I see a lot of question marks in front of this special router.
I really appreciate if you can help me find out if D-Link DI-400 I found in local market is compatible with DDWRT and has 4MB flash. Here is the one I checked today in a close computer shop:
D-Link DI-400: H/W: Ver A1 F/W: Ver 1.00 S/N: F3BG18100078
Looking forward to hear from you,
Many Thanks,
Peyman Nabati
Peyman Nabati,
This flashing guide is for Flashing DD-WRT onto the DIR-400. You can also check out DIR-300 if you don’t need the 108mbps wireless. Hope it helps
Hi,
I dared to try DD-WRT on D-LINK DIR-400 just bought a few hours ago. Quite honestly I followed the instructions published in flashing.txt available under this link:
http://www.dd-wrt.com/dd-wrtv2/downloads/v24/Atheros WiSoc/D-Link DIR400
My computer was connected to one of the LAN ports of router (not the WAN port as you described in your guide) and the first instruction I executed was : ip_address -h 192.168.0.2 as mentioned in flashing.txt .
The rest was carbon copy of what you instructed above and the messages I saw during the flashing was same as what you quoted above.
At the end my computer is still connected to a LAN port and its IP address is still 192.168.0.2 but I could not get to web interface of router at neither http://192.168.0.1 nor http://192.168.1.1 .
I can ping 192.168.0.1 successfully but I can not get to its web interface. The ping response time is not always under 1ms but it never exceeds 11ms (in range of 1ms to 11ms).
Coud you please kindly let me know what should I do next to be able to access to DD-WRT web interface on the router.
Many thanks,
Peyman
Peyman Nabati,
Have you change your IP address to DHCP?
Hi,
I have tried that already but my computer does not get IP address from router and at the end it indicates it did not get an response from DHCP server and has limited functionality. But as I said before it seems my router has the IP address of 192.168.0.1 since I have already one computer connected to the router (on LAN port) and I have sombody responding to my PING request on this address which presumably should be router.
Could it be that DD-WRT did register on a different port for its web interface (rather than default port 80)?
On the other hand, going over the installation procedure I do not see any point in this process requiring uploading the actual dir400-firmware.bin to the router from this link:
http://www.dd-wrt.com/dd-wrtv2/downloads/v24/Atheros WiSoc/D-Link DIR400
Does this file gets uploaded automatically in the process you described above?
Any comment regarding my question is deeply appreciated,
Peyman
Peyman Nabati,
Is the wireless lan led lighted up in your case?
The bin file is used when you upgrade the dd-wrt software on a dd-wrt set. Hope it helps.
Hi
Tell me please, is there a way to flash DIR-400 back to original firmware?
dmitry1972,
Flashing back to the original firmware shouldn’t be a problem.
Do you know some “how-to”? If you imply the same way as for DIR-300 (using the emergency web server), then I should disappoint you. I’m sorry, but this method does not work for DIR-400. The router reboots at 14% of flashing process and stops responding. The only way to revive it is to reflash dd-wrt. Most probably linux has not been loaded after rebooting. When I flashed dd-wrt back I saw that boot script is still “..fis load -l linux ..exec” (even after unsuccessful attempt to flash original firmware), but I remember that the original boot script was “..fis load -l vmlinux.bin.l7 ..go”. May this be a reason for the problem? DD-WRT firmware filename is linux.bin, but the original firmware filename is vmlinux.bin.l7. I think that flashing process of the original firmware was successful, but after rebooting linux can’t be loaded because the boot script is improper - the loader tries to load nonexistent linux kernel.
dmitry1972,
I think we have to segment the bin file from d-link and flash it in through RedBoot instead. Didn’t realized you tried my method of reflashing for the DIR-300.
Can you describe me step-by-step how I can extract required vmlinux.bin.l7 from the original firmware bin file?
One more question - can we get vmlinux.bin.l7 from DIR-400 with original firmware to flash it on DIR-400 with dd-wrt via RedBoot ?
The problem solved here http://www.dd-wrt.com/phpBB2/viewtopic.php?p=191142#191142.
dmitry1972,
Great! I will test it out later.
That’s a pretty nice piece of work!
There is a problem with mac address. It can’t be cloned.
Arthur,
What do you mean by “mac address can’t be cloned”?
Hi,
I have the DD-WRT on my D-LINk DIR-400, but can’t get the PPPoE to work, I think it is to do with the fact that I have set a gateway IP by mistake when flashing the device. Anyway, I want to revert back to the original D-Link firmware, but I cant find out how to get the vmlinux.bin.l7 and rootfs described by Dmitry1972 from the original Dlink firmware. Any help for a very green Noob would be greatly appreciated.