Monday, August 18, 2014

Reflashing a Linksys E2500 Router with DD-WRT Firmware

Have an extra router laying around (I plan on doing a cooler radio tutorial with the classic Linksys WRT54G router later) and I felt like reflashing the firmware; meh, why not?

This isn't necessarily something that needs a tutorial as the DD-WRT wiki pages and their walkthroughs are pretty thorough (yet still a little bit scattered on some parts, but pretty good), but having now done it, I think I could condense some of the reading (it's not very much) and make it even easier and faster to reflash firmware with confidence.

/***** WARNING *****/

This is a potentially very dangerous operation (danger is my middle name :P ) because if you don't strictly follow the procedures you could either write the wrong file size or begin writing to the NVRAM in the wrong place, thus "bricking" your router. Which usually means you now have a new plastic box and a scrap-board to get some spare parts off of...  While it's not 100% gone if you do this (there's some recovery procedures given, you would have to make or buy a JTAG connector), you really don't want to be messing around with all the frustrating errors and potentially permanent damage to flash chips, unless you enjoy learning and hacking it (I kind of do), then by all means brick your router and try to fix it!  Speaking of which, that would be a good tutorial to do...

So for the list of materials, you need:
--Linksys E2500 router
--12V power supply for the router
--A standard Ethernet cable
--Stopwatch
--A computer with an Ethernet port and web browser
--Software (firmware .bin files from online)
--Saved HTML webpages for offline use
--Thin button pusher for the router reset button (could be many things, so get creative)

1) First, check to see if your router has been ported with DD-WRT.  Initially I was going to flash Open-WRT but they didn't support the E2500, I was glad to see DD-WRT did though.  Odds are, you can flash some open firmware on your router.

2) Start off firstly by reading up on how to do this.  Once you do it, it's really not that bad; actually quite easy.  The firmware writing and porting is the real hard work.  Keep reading until you feel comfortable.  All it took for me was these pages:

http://dd-wrt.com/wiki/index.php/Linksys_E2500
http://www.dd-wrt.com/wiki/index.php/Installation
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=51486

Download and save all these pages and of course the binary firmware files to a thumb-drive or your hard-drive for off-line viewing, you can keep a separate device to still look things up online too.

3) Now the most annoying part of flashing router firmware, in my opinion, is the "30/30/30" reset.  I've never heard of it nor seen it in my limited embedded development experience.  You have the router plugged in, and while plugged in, you need to hold the reset button (not the one on front, but on bottom of the device) for 30 seconds, then still holding the reset button, unplug the router for 30 seconds, then still holding the reset button, plug the router back in for 30 more seconds; totally 90 seconds of holding the reset button.

Make sure you have a little thin solid object to hold down the reset button and that you situate the router and your hands such that you can easily unplug and plug in the router while holding the button down.  This is the hardest part of flashing, in my opinion, so not that hard.

4) Next connect your ethernet cable to the computer and your router.  Since you shouldn't be connected to the internet, disable as many plug-ins and add-ons, virus protection, and clear caches; just to avoid some funny errors.  Log into the web interface (type 192.168.1.1 into your browser).  Now, they recommend to strictly use Internet Explorer (the default Microsoft browser) but I was able to flash the router just fine with the open-source Iceweasel browser, which is very much like Firefox.  If you already have IE and you're on Windows, then go ahead and use that first.  It's funny because at where I'm interning now, Internet Explorer by default worked the best with a product, instead of say Google Chrome.

Anyway, the default User name for the E2500 (with Cisco firmware) is "root" and the default password is "admin".  Now click on "Administration" tab, then "Firmware Upgrade".  You should already have the firmware file.

/***** WARNING *****/

Make sure the firmware file is the "mini" one, read the file name used in the picture.  DO NOT FLASH ANY OTHER FILE BESIDES THIS ONE FIRST.  Another part here where you could really brick the router.  This file is needed before you can flash some other custom DD-WRT firmware.

5) So browse and find the file where you downloaded it, and click "Start Upgrade".  Now, here's why I said you need a stopwatch.  Wait for 5 minutes after you flash, to "insure integrity" as they say.  Then after that, unplug the router for 10 seconds to power cycle and wait for 3 minutes after plugging back in.  Then do yet another 30/30/30 reset.  Then wait for 3 minutes to plug in the ethernet cable and log into the web interface.

And that's it! Congrats you flashed the firmware!  Now you can download and flash other custom DD-WRT firmware.  Just make sure it's no bigger than 8MB and is specifically for the E2500!  Follow the same procedure above to reflash.  I honestly didn't see that many more new features in the "big" firmware than in the "mini", so I may try another one.

Depending on your knowledge of the internet and networking, you can customize a lot of settings in the router.  Like port settings, MAC-addresses allowed on, IP-logs, VPN settings, and on and on...I would leave most of the settings as default if you don't know them, and add the highest encryption (WPA2/AES) with a large key (63 chars), like you would make a secure password that's hard to crack.  You could also disable WDS as there's a tool to hack into routers using this PIN number...

Also, if this is another router not connected to your modem, you can go to Setup -> Advanced Routing -> Operating Mode, and select "Router" to establish a link.  There's another page for doing that as well:

http://www.dd-wrt.com/wiki/index.php/Wlan_Repeater

This covers it pretty well but I wasn't able to get it to work exactly how I wanted.  You have to disable a lot of security to do it, and I don't feel comfortable doing that.  I also don't have my own internet connection.  I'll eventually get it working how I want, and will update this post when I do.






2 comments:

Anonymous said...

I love DD-WRT! I use it on my routers!

Integrated MOSFET said...

Me too! Pretty cool! Hey first comment too, yay! :) Link your blog if you have one.