Installing OpenWRT on WZR-HP-G300NH from DD-WRT

Last month I bought a Buffalo WZR-HP-G300NH router and flashed it with DD-WRT open source firmware to use at my new home. However, I had problems with the router resetting itself periodically and with a weak WiFi signal. It appears DD-WRT for this router is not yet ready for prime time, though it may be in better shape by the end of the year.

Since I read that OpenWRT for the same router was fairly robust, I investigated switching from DD-WRT to OpenWRT. It turned out easier than I thought.

Using putty under Windows I did a ssh session to the router running DD-WRT. From there I downloaded the new firmware into the /tmp folder, trimmed off the 32 byte header and wrote the result to flash memory:

# cd /tmp
# wget http://downloads.openwrt.org/backfire/10.03.1-rc3/ar71xx/openwrt-ar71xx-wzr-hp-g300nh-jffs2-tftp.bin
# dd if=openwrt-ar71xx-wzr-hp-g300nh-jffs2-tftp.bin of=firmware.trx bs=32 skip=1
# mtd -r write firmware.trx linux

When the mtd command finished it dropped the connection to putty. I waited for the router to finish its reboot. Then I released and reacquired the IP address on Windows using ipconfig /release and ipconfig /renew. I launched the FireFox browser with 192.168.1.1 to configure OpenWRT. The first thing you should do once you’re connected to the web interface is assign an administrative password, because by default there isn’t one.

My next stumbling block was the fact that the WAN port had a different MAC address under OpenWRT than under DD-WRT. In DD-WRT the WAN and LAN ports on the WZR-HP-G300NH have the same MAC address, but in OpenWRT the WAN MAC address is larger by one. As a result DHCP from the ISP treated it as a new client that needed a new IP address, but the cable modem had already assigned its only IP address to the old MAC address. The solution was to pull the power cord from my Cisco cable modem, reconnect it and wait for the modem to reinitialize (watch the LEDs). Then do the same with the router. Reconnect ssh to the router and the WAN port has an IP address.

I also assigned Google’s open DNS server (8.8.8.8 / 8.8.4.4) to the router rather than leaving the default but I’m not sure if that was really necessary.

I set up the wireless SSID and selected WPA2 and a key. Finally I could specify transmit power to reach the whole building.

The OpenWRT UI doesn’t look quite as slick as DD-WRT, but it seems to work well and all the basic configuration seemed easy enough through the web interface. What I really liked best about the WHR-HP-G54 that this router replaces for me was its rock-solid reliability, followed by its WiFi coverage and feature set. With OpenWRT the WZR-HP-G300NH looks like a worthy successor to it.

27 thoughts on “Installing OpenWRT on WZR-HP-G300NH from DD-WRT

  1. Hello Jason,

    I did a 30-30-30 factory reset at one point while I was configuring DD-WRT, but did not do one right before or after flashing to OpenWRT and have had no problems with that.

    My current uptime is close to 11 days.

  2. This post is excellent! I just migrated to OpenWRT from dd-wrt following your instructions. No arp entries or tftp. So convenient!!! Thanks.

  3. No need for stripping the header, just use the sysupgrade image, which is the same as the tftp, just without the header.

  4. I have a wzr-hp-g301nh which I think is essentially the same thing. I was just wondering what a safe tx power is when running the OpenWRT firmware? I think mine is at 19dB with DDWRT right now but I would like to switch to OpenWRT. Thank you

  5. I have got a
    “Couldn’t open image file: firmware.trx!”
    error. 🙁

  6. Sorry, my mistake I skipped line 2 without noticing it sooner.

    Thanks.

  7. Yesterday I could connect to the newly flashed openwrt router through this method but after I cut off the power my router and reboot it again it I couldn’t connect to it via LAN cable. I tried holding reset button for 30 seconds but nothing happened.

    So, I figured that I might have bricked it.

    Any help is appreciated.

  8. Is your PC set up to get its IP address via DHCP? Is there are WLAN visible for the router?

    Luckily, it’s not that easy to totally brick that router (=make it unusable).

    You should still be able to re-flash a good image using tftp, which admittedly is not as convenient as installing a firmware update from the web interface or ssh session.

  9. WLAN is not broadcasting. I tried plugging in LAN Cable by using DHCP but ip doesn’t resolve. So, I tried manually assign ip to 192.168.1.3, but even so I still can’t ping to 192.168.1.1 🙁

    If I can’t ping to the router can I still tftp it? Sorry but I don’t really know about tftp.

  10. I have tried all the instructions for Mac, Windows and Linux.

    However, none seems to work. On Mac it says that route doesn’t exist or something of the sort.

    On Windows nothings the programs keeps retrying until it times out.

    On Ubuntu tftp also keeps sending until it times out.

    During the process DIAG LED lights up and LAN LED blinks. After a few seconds Router LED blinks for a few seconds then stays on like that.

    Yes, my LAN cable works.

    Does this mean it’s bricked?

  11. Hm, looks like I’m in the same boat as Pii here. Probably should have scrolled down to the comments section before running those commands on my router. This thing better not really be bricked…

    Pii, I have the exact same symptoms you do, but I have gotten it to TFTP in linux. I followed the command list here:
    http://www.dd-wrt.com/phpBB2/viewtopic.php?t=68899

    The red DIAG light stays on during TFTP. Immediately after TFTP completes however, it just blinks the green ROUTER light back on, and… nothing has changed, still no response on 192.168.11.1, no DHCP response, nothing. The firmware gets transferred, or at least appears to in every way, but it doesn’t stick.

    Let me know if you can get that to happen on yours and if you’re able to successfully re-flash it.

  12. Well, got it back working. If I flashed with the exact same DD-WRT firmware file I used to initially go from the stock firmware to DD-WRT, it took it.

    I guess it’s something where it was flashing some places but other data remained from DD-WRT, in the… NVRAM or somewhere? I don’t know nearly enough about how the storage systems on these things are structured.

    Anyway I’m back with a working (well, kindof working, that’s why I wanted to go to openwrt) router. But nothing I do seems to get openwrt onto the thing. I tried that mtd command again, and got back into the same semi-bricked state, and could recover the same way.

    I guess I can live with DD-WRT for now but hopefully someone will figure this out or make a openwrt firmware that doesn’t need TFTP, which is a pretty messy process.

  13. I tried flashing with Stock image, dd-wrt, openwrt images but none of the transfer ever took place.

    And I noticed that it is actually broadcasting SSID. But I couldn’t connect to it. Seems like my half configured openwrt could be preventing the TFTP transfers.

  14. I finally got it working by getting into safe mode. Drop another sysupgrade image and reflash the whole thing. Tx if you still need help just let me know.

  15. Hey Pii I am in the same situation as both you and Tx, how did you end up fixing your router? I have tried all the TFTP commands and the firmware just wont stick. If you can help me out, I really appreciate it. Thanks.

  16. @UT

    If you’re flashing from DD-WRT then use openwrt-ar71xx-wzr-hp-g300nh-jffs2-sysupgrade.bin (or squash package).

    I was flashing directly from stock firmware to OpenWRT and couldn’t get it to stick until I used openwrt-ar71xx-wzr-hp-g300nh-squashfs-tftp.bin

    This tutorial helped a lot: From :http://www.dd-wrt.com/phpBB2/viewtopic.php?t=68899

  17. Can’t explain this one, but when I ran this process in Ubuntu, my default network connection refused to grab a new IP from the router. When I booted into Windows, no problem. Had to go back to Ubuntu, delete the config for the ethernet, manually create a new one, then all was well (???). Hey, as long as it works.

  18. Hello, I just want to ask what is the exact procedure. I am very new to putty and flashing routers . So what is the port and ip address for putty ? where is the tmp folder? how do i put the file into the folder so the router could access it.

  19. hello,
    is there a specific hardware revision? openwrt only support atheros and broadcom right? is there any other hardware that was used to make this router. i dont want to buy the wrong one.

  20. Hi Joe,

    Thanks for the tutorial, but please put a big WARNING in the beginning so that users read comments first 🙂

    This does not seem to work 100% for everybody. Just now the procedure failed for me – I tried to upgrade from DD-WRT v24sp2-14998 to openwrt-ar71xx-wzr-hp-g300nh-squashfs-tftp.bin and it never came back online after rebooting.

    Had to revert back to v176 stock firmware using TFTP, will try to reflash it using a standard procedure now.

    Thanks!

  21. Follow the Migrate from DD-WRT to OpenWRT section of this link to flash router to OpenWRT: http://wiki.openwrt.org/toh/buffalo/wzr-hp-g300h#linux.command.examples

    Had two of these Buffalo routers and kind of semi-brick them at one time or another, maybe two or three times. Best way to perform the de-brick procedure is to use a network hub or switch in between your router and pc so your network connection on your pc will stay up at all time and not try to connect only after receive signal from its peer.

  22. Done a couple things, like VPN, Asterisk, Kerberos, etc. Right now trying to get OpenLDAP and Freeradius2 to work but still not working as I’m a bit new to this myself, but learning as I go. Best luck to all.

  23. As KanjiMonster says, it’s possible to use an image without the special header. Open the image you want to try out in a hex editor, and strip everything up to “27 05 19 56” (at least for atheros images). That said, I get “Erasing mtd failed: linux” in the end, and I’m not kicked out of dd-wrt ssh login shell. Router works as before the intent…

  24. The particular DVI DL Booster-style Additionally could increase an answer of 2560 back button 1600 as much as 2 hundred feet around normal birdwatcher dual-link DVI cords. In addition to significantly beyond the standard 15 base limit added by simply birdwatcher cords, the actual Booster-style makes sure that the actual online video transmission will be free from distracting artefacts like sparkles, static as well as outlines. DDC alerts will also be increased to ensure that the actual conversation sales channel involving the screen as well as the DVI origin will be robust as well as continuous. The particular DVI DL Booster-style Additionally is a wonderful answer for all looking for a cost-effective strategy to increase dual-link DVI online video.

    For more detail : http://www.dueltek.com.au

Leave a Reply

Your email address will not be published. Required fields are marked *