Apr 132009
 

This is mainly for my own reference… but may be useful to others, so I’ll publish it here.  We have two routers, one which we keep as a spare, is a D-Link DSL-504 (not a 504T… and not a Generation II) 4-port ethernet switch and router.

Recently, I noticed the unit was not firing up — the status LED remained off, and I could not remember what the IP address was for the life of me (I had changed it from its default, and had disabled the DHCP server).  As it turned out… it didn’t have one, the flash memory had become corrupt, and so it was not booting.

These routers have a RS-232 serial port on the back for a console, to which you plug in a plain 9-pin serial extension lead (not a null-modem) and hook up your favourite serial terminal program.  The unit spits out its messages at 9600 baud 8n1.  In the above scenario, you will notice the bootloader (PP boot) complain that there is “no ATMOS image present” or some such message, and it’ll drop you to a prompt.

Firstly, you’ll need the flash image to load back in.  You get that from the D-Link Australia website, just go to their support section and look up DSL-504.  You’ll find the firmware under the downloads, it comes in a 3MB ZIP file, when you decompress this, there’ll be a .bin file inside — this is your image.

There are two ways to stuff this image back into the device.  The most obvious is the way D-Link tell you to… that is… enter xmodem at the prompt, then upload it using the Xmodem protocol.  Slow… it takes about 30mins.  There is a faster way.

These routers are capable of booting off a network in much the same manner as a SGI workstation… that is… obtaining an IP address via BOOTP, then downloading the above image via TFTP.  The concept is exactly the same.  Set up your boot server as per the Gentoo/MIPS handbook — you won’t need the special kernel parameters… but the host setting will look identical.  Just place the .bin file you obtained earlier in your TFTP root directory, and point the filename parameter at it.  If you don’t know your router’s MAC address, type tftp and it’ll tell you, then reset the router.

Once all the settings are in, and the daemons are started… turn to your terminal emulator, and issue the tftp command. It’ll immediately download the image and boot it, should take a few seconds. It’ll tell you to type quit to boot, do this.

When it prompts for a password, just press ENTER… the password is blank (not “private” as D-Link will have you believe).

Upon booting, type config save to store the settings… Don’t make the mistake I made at this point — I tried mucking with the settings via serial console and had to start over (the webserver kept giving me a blank page). If you need to, isolate it from your network at this point, just plug in a machine with a web browser.

If you decide to muck around, and have to reset it… at the prompt, type flashfs wipe followed by restart, and you’ll be back to step 1.

From here, you should be able to visit the router’s homepage and configure it as if pulled straight out of the box.

  One Response to “Recovering a braindead DSL-504 router”

  1. Hah! I thought I was one of the last few guys that still had one of these at home… although I have the DSL-500 (Gen I) instead. Too bad for me it won’t work any longer (because I’m now on ADSL2) and the thing used to die _way_ too often when using rsync, bittorrent or anything packet-happy…