Monday, February 29, 2016

Installing OpenWrt on D-Link DIR-600 Router


The D-Link DIR-600 is a consumer grade router. Although it's not a new model, it is still a very capable router at a price tag and feature set that is difficult to beat. Also, OpenWrt can be installed on it to make it even more capable and more configurable.
The DIR-600 comes in several different hardware revisions. My router is B5. This is important as each hardware revision requires a slightly different approach.
Hardware version: B5


After much digging, trial and error I figured how to do it properly. The steps below contain the minimum steps (I found) to successfully upload the latest (15.05) OpenWrt build to the D-Link DIR-600 B5 router. The process is very simple and straightforward (once one figures it out), but it is fairly easy to mess it up, so double and triple check everything you type in the terminal.

The most important rule of thumb you need to follow is that while there is any kind of firmware upgrade is in process, do NOT switch off the router. If a firmware upgrade gets interrupted the router can take permanent damage.

Software tools/Environment needed

I performed the following on my test computer that runs a 64-bit version of Windows 10.
  • Web server - I used IIS from a current Windows 10 installation
  • Firefox browser - I also tried Edge, Internet Explorer and Chrome, they did not work.
  • Telnet client - I used the open source Putty.

Files needed

Get these files before you start the process, because once you start it you may not have internet connection (unless you have another router). Having the latest factory image at hand is also a good idea, although not required.


  1. Upload dir600b_v2.17_bbox-v1.19.1.bin to the router using the emergency firmware upload page.
  2. Telnet in to the router using Putty on port 2323.
  3. Switch to the /var directory: cd /var
  4. Download  from the web server (replace the Xs with the address of your web server): wget http://X.X.X.X/openwrt-15.05-ramips-rt305x-dir-300-b7-initramfs-uImage.bin
  5. Apply the downloaded firmware: busybox flashcp openwrt-15.05-ramips-rt305x-dir-300-b7-initramfs-uImage.bin /dev/mtd/2
  6. Reboot the rooter: reboot -f
  7. Upgrade to the latest build using OpenWrt's firmware update page.
Steps 2 to 6 shown from above
Success! OpenWrt seems to be fully functional on my D-Link DIR-600 router.
Status page of OpenWrt

What to do if you brick your router (and how/why I bricked mine)

This router is rather difficult to brick as it has some protection against not suitable firmware. However, if you do manage to make it unresponsive all is not lost. With a bit of soldering skills and some free and/or inexpensive tools it is possible to bring it back to life.

There is a step by step process described at for this model/revision, however, this process did not work for me and I ended up having my router "soft-bricked". This means that I managed to overwrite the factory firmware with one that was not working and I couldn't connect to the router any more using LAN or WiFi.

At this stage I went on to read up as much and as diverse information on the DIR-600 B5 as possible. The OpenWrt forums are a great starting point. Finally I ended up opening the router (as in I removed its case) and created a connection to its serial interface.
Serial port that needs some means of connecting to it
Pin header soldered on the board with breadboard cables connected to Rx, Tx and Gnd. Vcc is not required. The serial port uses: 57600 baud, 3.3V levels. 
Final setup, connected to a USB-Serial port adapter.
With the serial cable properly attached (see the label I added to the PCB for extra safety) I could now observe what really was going on in the router. When booting up the rooter I could see all the messages it spit out on the serial port. Looking through the messages I found that at some stage it displayed a menu and, very briefly, it was waiting for a selection, then it continued with a default selection of "3":
Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.
At the next boot I chose #1 and used tftp to upload the original firmware. At this stage the router was running the original firmware from memory - switching the router off would make it forget this. However, this was enough for me to get in to the emergency firmware upload page:
Emergency firmware upload page
On this page I was able to upload the original firmware to the router and restore its workings to factory default. Back to square one. At least I could continue to try other ways knowing that I can get back to this any time.

Software tools used

  • Tftpd32 - an open source, lightweight tftp client
  • Firefox browser - I also tried Edge, Internet Explorer and Chrome, they did not work.

Hardware tools used