Mini Flashing Guide for DIR-400


  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 and subnet mask to

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

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
RedBoot> ip_address -l -h
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 0x80ff0000-0x81000000 at 0xbffe0000: .
RedBoot> load -r -b 0x80041000 linux.bin
Using default protocol (TFTP)
Raw file loaded 0x80041000-0x803cffff, assumed entry at 0x80041000
RedBoot> fis create linux
… Erase from 0xbfc40000-0xbffcf000: …………………………………………………
… Program from 0x80041000-0x803d0000 at 0xbfc40000: …………………………………………………
flash_addr = 0xbfc40000
mem_addr = 0x80041000
entry_addr = 0x80041000
length = 0x38f000
img_size = 0x38f000
… Erase from 0xbffe0000-0xbfff0000: .
… Program from 0x80ff0000-0x81000000 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:
Local IP address mask:
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 0x80ff0000-0x81000000 at 0xbffe0000: .
RedBoot> reset

Enjoy your new DIR-400!


Treat shadowandy!

If these step-by-step guides have been very helpful to you and saved you a lot of time, please consider treating shadowandy to a cup of Starbucks.  

19 thoughts on “Mini Flashing Guide for DIR-400

  • June 15, 2008 at 5:05 am


    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

  • June 15, 2008 at 12:48 pm

    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

  • June 23, 2008 at 5:53 am


    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: 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 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 but I could not get to web interface of router at neither nor .

    I can ping 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,

  • June 23, 2008 at 8:04 am

    Peyman Nabati,

    Have you change your IP address to DHCP?

  • June 23, 2008 at 5:00 pm


    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 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: WiSoc/D-Link DIR400

    Does this file gets uploaded automatically in the process you described above?

    Any comment regarding my question is deeply appreciated,

  • June 24, 2008 at 9:02 am

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

  • June 26, 2008 at 2:04 pm


    Tell me please, is there a way to flash DIR-400 back to original firmware?

  • June 27, 2008 at 7:02 pm


    Flashing back to the original firmware shouldn’t be a problem. 🙂

  • June 30, 2008 at 1:22 pm

    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.

  • July 4, 2008 at 10:50 am


    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.

  • July 4, 2008 at 3:05 pm

    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 ?

  • July 10, 2008 at 1:37 pm


    Great! I will test it out later. 🙂 That’s a pretty nice piece of work!

  • July 23, 2008 at 10:14 pm

    There is a problem with mac address. It can’t be cloned.

  • July 25, 2008 at 9:01 am


    What do you mean by “mac address can’t be cloned”?

  • November 25, 2008 at 3:04 pm


    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.

  • December 7, 2008 at 1:21 pm

    Hello All friends

    I have bought a D-Link DIR Wireless Router.
    I can’t Configure it.
    I have a DSL connection using Subscriber Module.
    here are my IPs below>> For Subcriber Module.
    And i have another IP which i have to assign to my PC.
    Which i can have then only one connection.
    How do i configure my router using the 2nd IP>>>>> This is the 2nd IP
    Any Help Will be recommended.
    contact me via my email address

  • January 11, 2009 at 9:05 pm

    I am used to dd-wrt on the Linksys wrts. I just purchased a DIR-450 (EVDO support), I am not familar with the DLink product names, will this DD-WRT version work and still support the EVDO access on the DIR-450?

Comments are closed.