Martin

New lease of life for our D-Link Wireless Router

September 3, 2009 · No Comments

Since upgrading our wireless network with our new Netgear RangeMax Next Wireless-N Router Gigabit Edition (see my post ‘Belkin Wireless Router is just rubbish‘ explaining our upgrading path), our humble D-Link DIR-300 Wireless G Router seemed to be doomed into a life of gathering dust along side many other bits and pieces that I may have a use for one day.

D-Link DIR-300 Wireless G RouterThen I stumbled upon a forum post that stated it is possible to flash new firmware onto the device which not only un-restricts the hardware, but also enables a host of other goodies into the D-Link Wireless Router.

I followed the link to DD-WRT.com and it became apparent that doing this will add new functionality into the D-Link Wireless Router – I was particually interested in using the Wireless Router in client mode.

DD-WRT is a Linux based alternative OpenSource firmware suitable for a great variety of WLAN routers and embedded systems. The main emphasis lies on providing the easiest possible handling while at the same time supporting a great number of functionalities within the framework of the respective hardware platform used.
Taken from the DD-WRT-  About page.

Following the DD-WRT install instructons for the DIR-300, I set upon the task of breathing new life into the Wireless Router.

Prerequisites

  1. Plenty of patience (taking your time will ultimately save you time in the long run)
  2. Ubuntu Desktop with *wine and putty installed (you can use any OS, but this is how I did it)
  3. All the required files as well as the instructions available on your desktop (NOTE: This is D-Link DIR-300 Consumer Stable DD-WRT.v24 SP1, please check for newer versions if available)

* I had some difficulty using tftpd-hpa and atftpd (although it appeared to work intermittently) so I used tftpsrv.exe which can be downloaded from the required files link above.

Basic Install Guide

The following closely mirrors the actual install process mentioned in the DD-WRT wiki.

I found this script to be very useful in accessing the router and it is almost exactly the same as the one found on the DIR-300 DD-WRT installation page, so use the editor of your choice to create a file called redboot.sh on your desktop and make it executable (chmod 770 ./redboot.sh).

#!/bin/bash
# requires putty (sudo apt-get install putty)
echo
echo ""
echo "Enter hostname or ip address: "
read host
while true
do
   if eval "ping -c 1 -s 1 $host" > /dev/null; then
  echo "Router Awake"
       putty telnet://$host 9000
       #-m redboot.txt
       break
   else
       echo "Waiting for Redboot to boot. Press CTRL + C to quit"
    sleep 1
   fi
done

Now plug your computer into the internet port on the router and configure Network Manager to use the static IP address of 192.168.20.80.

NOTE: Network manager is sometimes not fast enough coming back online when the router is powered off and back on, so you can either take your chances, assign an IP the old fashioned way by removing Network Manager and editing /etc/network/interfaces or use a switch/hub to connect between the devices (like I did).

Unzip tftpsrv.zip to your desktop and right click the resulting tftpsrv.exe file selecting Open With “Wine Windows Program Loader”, all the required files on your desktop will now be available via the TFTPd service.

Now run the redboot.sh script you created earlier and type in the IP address of 192.168.20.81 when asked, then unplug your routers power for 5 seconds – then plug it back in while holding the reset button for 5 seconds – if all goes well, putty will open after a short wait.

On the RedBoot within putty, you can now type the following commands:

load ap61.ram
go

If the load ap61.ram command takes a long time, then double check the TFTPd service is running (if you run a firewall on your computer, you can temporarily disable it).

If all went well after typing the go, putty will now seem to be doing nothing and your router will now be using a temporary boot loader, it is now safe to close putty.

Reconfigure your IP again, this time set it to 192.168.1.2 and unplug the network cable from the routers Internet port and into the LAN port.

Run the redboot.sh script once again and this time give it the IP address of 192.168.1.1 when prompted, putty should now appear once again.

The next part is a direct copy and paste from the DD-WRT wiki, please note that you MUST take care and be patient with all the following steps highlighted in bold.

IMPORTANT: while doing the following steps. never plug off the lan cable or the power cord!

fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x807f0000-0x80800000 at 0xbffe0000: .
ip_address -h 192.168.1.2
IP: 192.168.1.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.2
fis init
load -r -b %{FREEMEMLO} ap61.rom
Using default protocol (TFTP)
Raw file loaded 0x80080000-0x800a8717, assumed entry at 0x80080000
fis create -l 0x30000 -e 0xbfc00000 RedBoot
An image named 'RedBoot' exists - continue (y/n)? y
... Erase from 0xbfc00000-0xbfc30000: ...
... Program from 0x80080000-0x800a8718 at 0xbfc00000: ...
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x807f0000-0x80800000 at 0xbffe0000: .
reset

If the above went well, your router should be restarting and will have a new permanent boot loader waiting for you to log into, so now close putty and run the redboot.sh script again using the IP address of 192.168.1.1 when prompted.

After another short wait, putty will be ready for the next step – installing the DD-WRT system image.

fis init
ip_address -h 192.168.1.2
load -r -b 0x80041000 linux.bin
fis create linux
fconfig boot_script true
fconfig boot_script_timeout 4

Now all that is left to do is make sure the linux image is always started at boot, so type fconfig and accept all the options until you get to the bootscript part.

fis load -l linux
exec

Once the configuration has been saved, you can type reset and close putty.

DD-WRT screenshotThe router will take a short while to boot back up and will be ready for you to log in via its web interface on 192.168.1.1 where you setup the username and password for administration.

You are then left with simple to use web administration pages to configure and customise to your hearts content with AP, Client, Client Bridge, Adhoc, WDS Station and WDS AP wireless modes supported.

So thats it – all done – well, it wasn’t quite finished for me, I wanted to put the router into client mode and followed another howto on the DD-WRT wiki.

I currently have one of my spare computers plugged into the newly configured D-Link DD-WRT client and wrote this entire post using it connected to our main wireless network. As the D-Link has 4 Lan ports (there is a setting to turn the Internet port into a 5th LAN port – but I have not tried it yet), this method is a great way to get network devices (network storage, HTPC devices and wired computers) onto the wireless network.

Categories: Networking
Tagged: , ,



0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below..

Leave a Comment

Powered by WP Hashcash