ASPENSMONSTER Just another WordPress site

May 12, 2011

Flashing the WRT54G v5 with dd-wrt

Filed under: Uncategorized — aspensmonster @ 3:11 am

Flattr this!

dd-wrt logo

I know this isn’t anything new. However, I figured I’d provide a unified guide to the process for anyone who finds himself the owner of a WRT54G in the year 2011. The resources are out there, but they tend to be scattered across different posts in different threads across different forums. The primary source is certainly thorough enough:

but figuring out the various kinks to get it working with my network (Xbox 360 with a WGA54T v2.1 wireless bridge, routers behind routers, SBC Global / AT&T DSL, Speedstream 5100 DSL modem) proved more difficult to find.


0.) Definitions

  • Power Cycle – Remove the power cord from the device in question for 30 seconds, and then reconnect it.
  • Hard Reset – With the device on, hold the reset button down for 30 seconds. Continuing to hold the reset button, unplug the power cord from the device for 30 seconds (a powercycle, basically). Continuing to hold the reset button, plug the power cord back into the device and hold the reset button for 30 more seconds before letting go. In short, the reset button should be depressed the entire time.

1.) Preparing the required tools

You can download the required tools from this forum page :

Local mirror (please only use if previous link is down) :

  1. Extract this zip to a location that you’ll remember come time to use the tools inside it (like the Desktop).
  2. Extract the file in the same folder.
  3. The final file structure ought to look like this:
    • Gv5Flash
      • vximgtoolgui
        • cfe.bin
        • common.dll
        • vximgtoolgui.exe
        • wrt_vx_imgtool.exe
      • dd-wrt.v24-12548_NEWD_micro.bin
      • tftp.exe
      • vxworks_prep_v03.bin

2.) Installing dd-wrt

UPDATE May 11 2011 : The firmware that is installed by downloading the above zip is old. It still works for flashing the router, but I highly advise you immediately flash to the latest firmware revisions once you successfully complete the process below with the older firmware. You can see section seven for upgrading to the latest firmware revisions.

Now for the fun stuff! You know, actually installing dd-wrt. This section is pretty much verbatim from this link:

CAUTION The file contains windows binaries. I’ve heard that they run fine in wine, but I decided to complete this process under a windows installation just to avoid any potential pitfalls going that route.
  1. Connect your machine to one of the LAN ports on the router. Disconnect all other routers and wireless devices, and turn off any firewalls. (I did most of this install with my DSL modem hooked into the WAN port, your mileage may vary.)
  2. Assign your computer a static IP address with subnet mask ( in windows, Control Panel >> Networking >> Manage Connections >> Right-click card + Properties >> Select TCP/IP v4 >> Click properties >> Assign static info)
  3. Perform a Hard Reset of the router.
  4. Start VXImgToolGui.exe . Make sure you’ve selected WRT54G, supply the MAC address (usually located on the bottom of the router) and save the image as My54gImage.bin inside the Gv5Flash folder.
  5. Perfom a Power Cycle of the router.
  6. Navigate to in the browser. The login is username “root” and password “admin”. You should NOT be at a Management Mode page. If so, Power Cycle again.
  7. Go to Administration and Firmware upgrade and select the “vxworks_prep_v03.bin” file in your Gv5Flash folder and hit upgrade.
  8. Once the upgrade is complete, wait FIVE FULL MINUTES and then Power Cycle the router.
  9. Browse to (if there’s a blank page, clear cache and try again). You’ll be in Management Mode. Select the My54gImage.bin file you created and hit Apply.
  10. Wait for the “Update Success” prompt and then wait FIVE FULL MINUTES before proceeding.
  11. Start up tftp.exe and do the following:
    1. Enter for the address.
    2. Leave the password blank.
    3. Select the “12548 Newd_Micro.bin” firmware.
    4. Set retries to 99.
    5. Power Cycle the router.
    6. Wait 30 more seconds.
    7. Hit Upgrade.
  12. After you get the Success prompt, wait FIVE FULL MINUTES.
  13. Attempt to access the dd-wrt webgui at . Once you can access, Power Cycle your router.
  14. Attempt to access the dd-wrt webgui at again. Once you can access, Hard Reset your router.
  15. Attempt to access the dd-wrt webgui at again. If you can access, reset your ethernet connection to automatic settings (as opposed to the static settings we gave earlier).

3.) Configuring PPPoE DSL with Speedstream 5100

This was one of the trickier aspects of getting dd-wrt working. My previous wireless router did not require me to make any changes whatsoever with my DSL modem. Not the case here. However, once the DSL modem is set up correctly, getting PPPoE running is a snap.

  1. Disconnect the router from the computer and plug the DSL modem directly into the computer.
  2. Connect to the modem. On my Speedstream 5100 it is at address .
  3. Click on setup (I think) and set it to bridge mode.
  4. It may ask you for an access code. It is a ten digit code typically printed on the bottom of the modem.
  5. Reboot the modem.
  6. Connect the computer back to the router, and plug the ethernet out port on the modem into the WAN port on the WRT54G router.
  7. Enter the dd-wrt webgui.
  8. Under setup, switch from DHCP to PPP connection.
  9. Provide your credentials and save.
  10. Power cycle both the router and the modem.

At this point, the modem should be bridging between the ISP and your router and you should have internet access. I didn’t need to modify any of the other settings. I would leave them all at default unless otherwise necessary.


4.) Configuring Wireless Xbox 360

I use an old (original Xbox era) wireless gaming bridge, WGA54G v2.1 . Apart from not supporting the WPA2 protocol, it still does its job just fine.

Notes regarding WEP encryption and authentication

I encountered errors with WEP. I originally had my wireless network using WEP encryption (yes, I know it’s insecure) and for the life of me, I could not get the Xbox 360, WGA54G, and dd-wrt WRT54G to successfully connect to each other. The best that would happen is the Xbox 360 would recognize the wireless network, but would not authenticate.

I suspect this is because on my old wireless router, I had the option of using a 128-bit alpha-numeric passphrase, which still had to be 13 characters long, but wasn’t limited to 0-9 and A-F. I’m guessing that dd-wrt doesn’t support this functionality and that this is why the Xbox 360 wasn’t able to authenticate. I tried getting my G1 smartphone to authenticate against WEP and it too wouldn’t budge when I tried the alphanumeric key. So I’m pretty confident this was the problem. Gave me an excuse to upgrade to WPA in any case. If you absolutely must use WEP, then I’m guessing you will have to use the hex keys.

Configuring the WGA54G v2.1

However, using WPA meant I would need to reconfigure the WGA54G. I couldn’t find the disc with the software to do this and tried looking online for the software. I couldn’t find it anywhere. The best I could find was a guide from Linksys stating to access the device directly via a browser, something that I could not accomplish. Several hours later, I found the disc. If you too cannot access the device directly and cannot find your disc, I present it to you in the form of a .iso :


The instructions from this point on are simple:

  1. Connect the WGA54G directly to the computer.
  2. Load the CD into your computer (or mount the above image)
  3. Follow the prompts to use the device as a bridge (NOT head-to-head gaming) and use WPA encryption. Specify the SSID and password.
  4. It will ask you if you want to use a static ip or dhcp. It doesn’t matter. We’ll be sidestepping this with a static lease to the Xbox 360 MAC address.
  5. Find the Xbox 360’s MAC address. Xbox 360 >> System >> Network Settings >> Edit Settings >> Additional Settings >> Advanced Settings >> Wired MAC address.
  6. Use those^ settings in the Network Settings area of the Xbox 360.

Setting up Port Forwarding for the Xbox 360

I’m not sure if these are entirely necessary or not –I added them while I was still trying to get WEP to work– but it can’t hurt to enable them. The port forwarding section is located at the WebGUI >> NAT/QoS >> Port Forwarding .

Application Port From Protocol IP Address Port To Enabled
xbox360 3074 Both $your_xbox_static_ip 3074 Checked
xbox360 88 Both $your_xbox_static_ip 88 Checked
xbox360 53 Both $your_xbox_static_ip 53 Checked
xbox360 80 TCP $your_xbox_static_ip 80 Checked

Be sure to hit the “Apply Settings” button at the bottom once the table is filed in. Failing to do so will not save the table and you will have to redo the table. Also, by $your_xbox_static_ip I mean whatever IP address (192.168.1.*) you assigned for the DHCP static lease for the Xbox 360.


5.) Port Forwarding for torrents, minecraft, steam, etc

I would again recommend a static lease for the machine that will be using the service. You could utilize UPnP, but I prefer the linear approach that leaves control over the network in my hands. Once you have a static IP leased for the box in question, set up the following port forwards for torrenting and steam.

NAT/QoS >> Port Forwarding >> Add

The minecraft port forward is only necessary if you are running a minecraft server (which I am). I have never needed to add port forwards just to use the client and connect to other servers.

Application Port From Protocol IP Address Port To Enabled
minecraft 25565 Both $your_minecraft_server_static_leased_ip 25565 Checked
torrent $your_incoming_listening_port Both $your_machine_with_torrents $your_incoming_listening_port Checked

NAT/QoS >> Port Range Forwarding >> Add

Application Start end Protocol IP Address Enabled
steam 27000 27015 UDP $static_ip_of_client Checked
steam 27020 27039 TCP $static_ip_of_client Checked

If you have multiple devices on your network that need to use the same service, then you could establish the above settings under port triggering instead. This will only work if the machines in question are not querying the same services (same port) simultaneously. If there are multiple devices that must all access the same service (same port) simultaneously then you are limited to either UPnP or port staggering. By port staggering I mean, for example with torrenting, giving each torrenting machine it’s own listening port. For other services (like steam gaming) it may or may not be possible to force the client to use a particular port (like 27015-27030 for counter-strike, for example).

Update May 11 2011 : Open steam >> Library >> Right-click the game you want to play simultaneously >> Properties >> Set Launch Options and add “-p 27001” (or any other port between 27000 and 27015) . You will then need to assign a port forward for this particular port for the IP of the machine in question.


6.) Final Stable Configuration and Conclusions

I consider stable to mean optimally functional while simultaneously under all of the following conditions:

  • Maximum download and upload speed
  • Torrents (up to 500 simultaneous connections)
  • Netflix Streaming (via wireless Xbox 360)
  • 2 other wireless clients browsing the web (youtube, etc)
  • At least one other wired client browsing
  • Extensive QoS listing
  • Extensive Port Forwarding listing
  • 3 DHCP Mac-based static leases

If the router cannot handle this kind of behaviour, then that means it’s time to either overclock or upgrade to a better router. Sadly, the WRT54G v5 cannot take all of those at once. This particular board just can’t handle torrent traffic, even with simultaneous connections as low as 70 and 80. It cannot handle torrent traffic even when that is the sole source of network activity (one machine >> WRT54G >> Modem >> Internet) and yes, one machine >> Modem >> Internet performed just fine with connections in the 100-200 range. However, removing torrents from the equation permits all of the other functionality to operate simultaneously.


If there is one thing keeping dd-wrt from a perfect score on this particular router, it’s the QoS. It’s horrendous. Simply having QoS turned on, even without any rulesets, causes the router to become inaccessible both via web interface and telnet. It still serves content but at a stunted pace. Perhaps it’s just the WRT54G v5 hardware (I will be putting dd-wrt on a WRT54G-TM next) but I’ve heard otherwise. I’ll be making another blog post about flashing the WRT54G-TM and if QoS is poor there too, then it will turn into a guide to put Tomato on the WRT54G-TM instead (Tomato is another open-source firmware that is prized for its interface and impressive QoS abilities).

As well, I’ve heard that the WRT54G v5 is a complete piece of shit when it comes to torrenting. Given my experience, I’m inclined to agree. Enabling torrenting for even a few minutes renders the dd-wrt web interface and telnet inaccessible, as well as the wireless access point. Wired data and torrents will still run though (for a few hours at least usually before requiring a power cycle). The link recommends the WRT54GL instead. It appears that even dd-wrt agrees, as noted in this wiki article regarding “neutered” WRT54G routers.

All in all, I would not recommend this router. I enjoyed the learning experience, and it does run fine without torrents, but it really is too neutered to trust with anything substantial. However, I would recommend dd-wrt, crappy QoS not withstanding.


7.) Upgrading to latest firmware (build 14896)

The instructions above work very well for getting an old version of dd-wrt on the WRT54G v5. However, I would recommend running the latest available build to avoid any nasty bugs. I encountered a bug wherein the router would be configured to have a WPA secured access point, but would instead broadcast as WEP, rendering the access point visible but inaccessible to any nearby devices. Turns out it was a bug that was fixed in a later revision of the firmware.

In any case, visit the website and search the router database for “WRT54G”. Select the v5, and then from the drop-down choose the latest available build (14896). It is a .bin file. Download this file.

  1. Be sure to write down any configuration settings you have (you cannot migrate settings from one firmware version to another).
  2. Perform a hard reset of the router.
  3. Log into the webgui and navigate to Administration >> Firmware Upgrade
  4. Choose to restore to defaults after flashing
  5. Browse for the .bin file you got from dd-wrt and then click Upgrade.
  6. After a few minutes, a new prompt should pop up saying that the upgrade was successful. WAIT FIVE MINUTES before clicking continue.
  7. Perform another hard reset
  8. If you can log in, then the firmware was upgraded successfully.

Personally, I didn’t heed the recommendation to perform a hard reset prior to upgrading. When I clicked the Upgrade button, I let it sit there for a good 20 minutes with no results. I then power cycled the router and was able to log back in. The firmware appeared to have been upgraded. I performed a hard reset and then logged in again. The firmware change persisted. I then added all my settings back in.

May 7, 2011


Filed under: Uncategorized — aspensmonster @ 5:10 am

Flattr this!

Just stumbled across this little gem. Some sort of “favorite movie test” game:


And now for the mathematics behind it. Consider your number to be ‘Z’

Z = n

And now let us multiply by 3

Z =  3n

and then add 3

Z = 3n + 3 = 3\left(n+1\right)

and then multiply by three again

Z = 9\left(n+1\right)

So no we have an expression for whatever your number is, given

1 \le n \le 9

Now the test wants us to add the digits of this number to get a resultant which is supposed to be our favorite movie of all time (OF ALL TIME!). Let us consider the digits of Z to be a and b, wherein a is the tens and b is the ones. Consequently

Z = 10a + b

is a true statement, given the nature of the decimal system. The question becomes, under what conditions will equality hold? That is, when will

Z = 10a + b = 9\left(n+1\right)

all equal each other? One possibility is if the digits behave as so: a=n and b=9-n . In this case, we have

Z = 10a + b = 10n + \left(9-n\right) = 9n + 9 = 9\left(n+1\right)

Given this constraint on the nature of the digits, we can conclude that the sum of these digits would always be

a + b = n + 9 - n = 9

So, if 1 \le n \le 9, and if a=n, and if b=9-n, then the sum of the digits will always be nine, and you will be forever doomed to having The Joy of Anal Sex With a Goat be your favorite movie of all time, OF ALL TIME!

I’m sure there’s a way to use modular arithmetic to better “prove” this problem without resorting to my cheap shot of “well, if a and b act like this, then POOF!”, but I don’t know modular arithmetic. Maybe I’ll update this later.

UPDATE: Yeppers. Theorem stating that any number divisible by 9 must also have a digit sum that is divisible by 9. If digit sum is divisible by nine, then the number is divisible by nine (iff statement. goes both ways. same goes for 3). I’ll update later with a better exposition.

« Newer Posts