Friday, July 6, 2012

Installing dd-wrt firmware on Japanese routers

DD-WRT initial information page displays 99% of the information many people are seeking when accessing their router:
WAN IP, WLAN clients, and DHCP clients
If you've ever used a Japanese router, then I don't need to explain to you what is wrong with the firmware. Lack of English is over shadowed by the lack of functionality and organization. Before delving into a Japanese router, I do my best Clint Eastwood and chant "Think i-mode". Even so, doing something simple like cloning a client MAC address - or even displaying a list of connected clients - can be infuriatingly, ridiculously convoluted and painful. At best. At worst, stuff that should work simply doesn't and functionality that should be there just isn't.

Buffalo's router firmware landing page is both useless and ugly.  

Fortunately, there is dd-wrt.

dd-wrt is a third party router firmware that is compatible with a large number of makers. Not only does it not suck, it also offers the choice of multiple languages. The router database can be checked for models that are compatible, but since model numbers and hardware revisions often are slightly different across regions, don't expect to find many (if any) Japanese models listed.

It seems the best chance of support for the routers commonly available in Japan is Buffalo, though there may be some issues. Of the other routers available at Yodobashi, such as Logitech, NEC, I-O Data, and Corega, none are found in the dd-wrt database. Only one Planex router is in the database. This doesn't necessarily mean it won't work, since it's less the maker and more the chipset, but the firmware would likely need to be ported.

One of my routers, the Buffalo WHR-G301N is apparently the Japanese version of the WHR-G300N v2, and can be upgraded to dd-wrt by the same instructions. Some Buffalo routers actually shipped with dd-wrt preinstalled as a "pro" firmware. As far as I've seen, all Buffalo routers in Japan have the "junk" firmware preinstalled.

Read on to fix this "bug" for the WHR-G301N.

WARNING: This will void warranty and potentially brick your router. Proceed at your own risk!

1. Downloads


There are two files that are needed:
  1. buffalo-to-dd-wrt_webflash-MULT.bin
  2. whr-g300nv2-firmware-MULTI.bin
The first file, buffalo-to-dd-wrt_webflash-MULT.bin is need to flash dd-wrt from the web interface when Buffalo firmware is installed on the router and should be all you need. The second file is what is used when upgrading this router from another version of dd-wrt.

However, the latest version (06-08-12-r19342) results in an Incorrect Firmware (ファームウェアデータが正しくありません) error. I used the same file found in this blog entry: from the 2011/06-14-11-r17201 build. So, I first flashed an older version of dd-wrt, and then upgraded to the latest version, which is available here:

http://www.dd-wrt.com/dd-wrtv2/downloads/others/eko/BrainSlayer-V24-preSP2

Click through to the latest version by, currently 2012/06-08-12-r19342, and choose buffalo_whr_g300nv2. Download the latest whr-g300nv2-firmware-MULTI.bin file.

2. Bypass Buffalo Protections


Assuming you've made no changes from the factory defaults, login to the WHR-G301N administration screen at 192.168.11.1 with username root and no password.

Next, click the administration settings tab (管理設定), and click the firmware update (ファーム変更) tab.

Is this Amateurish CSS and html or do the subtabs only render properly in IE 6?

My firmware version is WHR-G301N Ver. 1.82, and from what I can tell, there are unlikely to be any updates to this. From update method (変更方法), choose local file (ローカルファイル指定), and select the whr-g300nv2-firmware-MULTI.bin from the older build directory.

If all is correct, you'll get the following screen. While it's completely unnecessary, I've decided to translate this into English, since some of what's written is totally ridiculous.

Even this is ugly.
ファームウェア変更中です。
DIAG-ランプ点滅ちゅうは電源を絶対に切らないでください。
あと約180秒、お待ちください。
その後、設定を続ける場合は、次の手順を行ってください。
  1. WEBブラウザーを全て終了してください。
  2. お使いのパソコンとエアステションが通信できる設定になっている事を確認してください。
  3. ユーティリティーからWEBブラウザーを起動してエアステションのWEB設定を行ってください。
ユーティリティーの使い方はマニュアルを参照してください。
Updating firmware.
Be sure not to turn off the router until the diag light stops blinking.
Approximately 180 seconds remaining.
Do the following if continuing to update settings.
  1. Close all web browsers. [like this is necessary.]
  2. Confirm your PC has a connection with the router. [Ok, this is good advice]
  3. Start the web browser from the utility disk and run the web settings application [Totally unnecessary.]
Consult the manual for instructions on running the utilities.

3. Confirm settings


After that, the router should be reset with dd-wrt firmware installed. You may want to reboot the router. From the initial screen below, you can see that, right there on the welcome page, is exactly the information I want to see: that I have no WAN address (because I'm not hooked up to a simple DHCP Server)


I didn't bother changing the password right away. I first setup my WAN to make sure I had an internet connection, then jumped over to admin/firmware to upload the latest version.

4. Upgrade to the latest firmware version


Select the whr-g300nv2-firmware-MULTI.bin file you downloaded from the most recent build folder. When upgrading dd-wrt, there is a nice option to wipe all settings after flashing or leaving them intact.


5. Set up for Japan


I really like that dd-wrt allows you to set the "regulatory domain" to enable and disable features based on local laws. Of course, you have to trust that the maintainers of dd-wrt got this correct.

From wireless/basic settings, check the advanced setting box, and select Japan as the regulatory domain. Doing so enables two additional channel width settings, Turbo (40 Mhz) and Dynamic (20/40 MHz), as well as channel 14. As far as I can tell, this is appropriate for Japan. To take advantage of this increased bandwidth, you'll need to set WPA2-AES security. (NOTE: Android seems to need AES+TKIP.) However, if there are many routers in your area, doing so my actually decrease performance, since the needed bandwidth may not be available.

Also, channel 14 is only used for 802.11b in Japan, and should technically be unavailable when enabling only g and/or n. This is not the case, so using channel 14 could cause all your gear to fall back to 11 Mbps b speeds.

Another potential issue is the transmission power. I've read elsewhere that the initial setting of 20 dBm is in excess of Japanese denpa-hou and should be lowered to 10 dBm.
電波強度を下げる
日本の法律に従い、無線LANの送信出力はちゃんと10dBmに下げましょう。(初期設定だと20dBm)
I've been unable to confirm this. I've been passed a link to an MIC page showing that, in the 2.4 GHz range, power needs to be under 35 µV/m. Here is a page on calculations (PDF). Enjoy.

According to wikipedia, 10-15 dBm is around the range of a typical notebook computer's wifi transmitter. In general, it is probably best practice to set the power to the lowest possible level that gets you decent coverage in your area. This not only reduces the chances of unauthorized access to your network, but will also interfere less with your neighbor's wifi.


31 comments:

  1. I have the same router as yours and I did the flash without problem. However port forwarding seems to not work or at least it the settings don't show up after being applied. Any ideas?

    ReplyDelete
  2. Seems like a lot of trouble when you can just use pfSense.

    I 100% agree with your comment "If you've ever used a Japanese router, then I don't need to explain to you what is wrong with the firmware. Lack of English is over shadowed by the lack of functionality and organization."

    ReplyDelete
  3. Settings showed up for me, hitting apply, the save...

    ReplyDelete
  4. It took about 15 minutes or so, most of which was waiting on the router to load firmware and reboot. Would have been much shorter if the latest version was signed/encrypted properly.

    ReplyDelete
  5. You noted that Android needs AES+TKIP, but my Galaxy S2 is running fine with just AES. I'm guessing you ran into some problems?

    ReplyDelete
  6. Yeah, wouldn't authenticate. just kept throwing up authentication errors. I'm not using a stable build of Android, though (CM9 rc1), so it could have been phone phone.

    ReplyDelete
  7. Japanese software, middle-ware, firmware, (all of the above) is garbage. Japanese are not required to do any critical thinking at the university level, hence it's crap. 95% of their programmers, have no degrees in computer science, most of them, have some kind degree in English language, History, Economics, and they took a couple A++ test, and studied some html, and they think they can program linux... Seen this first hand, unfortunately I've worked with too many of them... Japanese companies do not fire for incompetence, that's why you read about PS3 getting hacked over and over and over again... The same Todai educated people are still there.. (Yes, Todai teaches by rote learning...)

    ReplyDelete
  8. any idea where to get the latest stable build? It seems to have been removed from the ddrt website.

    ReplyDelete
  9. nm, I found it here:


    http://www.dd-wrt.com/site/support/other-downloads?path=others%2Feko%2FBrainSlayer-V24-preSP2%2F2011%2F

    ReplyDelete
  10. I just got handed a WZR-300HP, but I'm having trouble getting it past the "Incorrect Firmware" Stage. Do you know of any other way to crack the safeguard Buffalo has on the router firmware versions?

    ReplyDelete
  11. Henry Ashley-CooperNovember 1, 2012 at 5:28 PM

    Got DDWRT installed, thanks for the advice.


    However, I have no idea how to set it up to provide a username and password to the modem. I tried entering the relevant info in PPPoE settings, but I am still stuck without any WAN connection. It reads WAN IP:0.0.0.0 in the top-right corner, so I guess there is an issue between the modem and this router.


    Anyone know what info is required? I am using a NTT fibre optic modem.

    ReplyDelete
  12. the PPOE is usually an email address and password provided by your ISP. It may have been in a letter you recieved from NTT.

    ReplyDelete
  13. Of course you need to confirm the PPPoE credentials and make sure you are entering them correctly. Hopefully you copied all that down before wiping the factory firmware.


    Are you sure that the credentials are entered in to the buffalo router? My NTT fiber optic modem is an iP phone adapter and router, so I enter the PPPoE information into it the buffalo router is assigned an address behind the NTT modem/router's NAT.

    ReplyDelete
  14. Is this one actually supported?

    ReplyDelete
  15. I actually have a Japanese WHR-G300N and was wondering how I can check the version number so I can flash it with the appropriate firmware from dd-wrt. How can I check the units version number?

    ReplyDelete
  16. it is usually listed on the bottom of the router near the model number it wall say v2 or similar.

    ReplyDelete
  17. Thanks Nicholas.
    Was the upgrade rather painless? Better to follow this tutorial or the one on dd-wrt?

    ReplyDelete
  18. @SBSdroid:disqus will need to comment on that since that was his post and did all of the work on this particular router.

    ReplyDelete
  19. The last post here was 3 months ago. Does this still work with the "WHR-G301N"? Has there been any updates to the firmware that I should know before I purchase this router from Kakaku? Thanks in advance.

    ReplyDelete
  20. Thought I should add some details as to why I am wanting to do this to make sure I am pursuing this right. I was planning on using a VPN service STRONGVPN, and DD-WRT to get access to Netflix from the USA. I will have 2 routers, one for the USA vpn (connecting to a ps3) and one for the Japanese side. Anything else I should know?

    ReplyDelete
  21. yes. I don't know about newer firmware versions because I haven't flashed them. At the very least, these instructions work for that router.

    ReplyDelete
  22. I run into trouble after step 2. It installs OK but then nothing happens. I turn off my router and put it back on and the old ip address doesnt work. cant figure out the new firmware's ip

    ReplyDelete
  23. Thank you so much for this post. I have exactly the same router and probably a much lower level of Japanese (i.e 0). Everything ran perfectly following your instructions; however dd-wrt never really worked well for me - wireless kept dropping out along with various other problems. I just didn't have the expertise to troubleshoot it and I knew the Japanese firmware always worked well. The one feature I really wanted ( switching off wireless via the AOSS button ) didn't work with the three different brainslayer firmware builds I tried. Anyway I discovered you can actually flash this router with US firmware! Instructions below presume the router's address is 192.168.11.1 - I am no expert so follow this at your own risk! ** Pretty sure part (1) is necessary, but not sure.

    (1) Restored the router to the original Japanese firmware:(note:: I couldn't get this to work with Ubuntu's tftp so followed this guide exactly http://dd-wrt.com/wiki/index.php/WHR-G300N_V2 except I used Parted Magic rescue disk's tftp with command # tftp -l whrg301n-182 -p 192.168.11.1)

    REF:: http://buffalo.jp/download/driver/lan/whr-g301n_fw-win.html
    REF:: http://dd-wrt.com/wiki/index.php/WHR-G300N_V2
    REF:: http://partedmagic.com/

    (2) To Change to English version:
    download whr-g300nv2_fw182.zip from buffalo US site
    extract whrg300nv2-182 from zip file
    boot computer with Linux rescue disk. I used Parted Magic
    open browser (firefox)
    restart browser if you have been logged into router to clear normal login cache:
    http://192.168.11.1/cgi-bin/cgi?req=frm&frm=py-db/55debug.html
    username: bufpy
    password: otdpopy
    click on telnetd -> start
    From a terminal::
    #telnet 192.168.11.1
    #ubootenv set accept_open_rt_fmt=1
    #ubootenv set region=US (not sure if this is necessary)
    log out of telnet
    unplug router, power and all cables.
    in a terminal type:: # ifconfig eth0 192.168.11.2
    on the back of your router will be an SSID number e.g. 106F4BCC5347
    in a terminal type:: # arp -s 192.168.11.1 10:6F:4B:CC:53:47
    (note: not this actual number 10:6F:4B:CC:53:47 - it's made up )
    open a terminal in the same directory as the US firmware file whrg300nv2-182
    type # tftp -l whrg300nv2-182 -p 192.168.11.1
    (note:: I couldn't get this to work with Ubuntu's tftp hence Parted Magic).
    As you do this, plug in the router power and ethernet cable that connects to your computer ( not in the blue wan port ) and keep trying to upload the firmware file, it may fail a few times, by hitting the up arrow on your keyboard and Enter. You should see a progress bar if successful.
    The router should take several minutes to reset and you should see an English version of the firmware, once all has settled. The only setting I couldn't recover was the Japanese ntp server (ntp1.jst.mfeed.ad.jp) so make a note of that before doing this.

    REF:: http://wiki.openwrt.org/toh/buffalo/wzr-hp-g300h#locked.u-boot.too.short.time.tftp.window

    ReplyDelete
  24. Wireless access point-wise, DD-wrt equipped Buffalos are the best. I once used it with the original firmware and it freaked out and reset itself. The default mode has DHCP on and started highjacking hosts.

    Pfsense is extremely good as a main router, but if you have a bigger deployment that covers a few floors. I'd trust the dd-wrt Buffalos more than any routers with Japanese firmware.

    I've also purchased some 500 yen old IO-Data G routers as WAP, their firmware is SO bad that it can't even do AP mode. It has to go in Router mode.

    ReplyDelete
  25. It would come with your contract at-a-glance sheet. You will need a user name and password.

    It would look like like. sdflj3sld@ocn.ne.jp
    password: sldkfj2dSd

    ReplyDelete
  26. It's not supported. I asked the landlord to return it. WHP-HP-G300N works. I've got 3 of them on dd-wrt. You apply the same trick.

    ReplyDelete
  27. Help me. after the installation of the firmware. then reboot the router I can;t connect to the router now. Power in lit and wifi is blinking. Please help.

    ReplyDelete
  28. ops sorry it is now OK. default IP is now 192.168.1.1

    ReplyDelete
  29. Does this work for the WHR-300?

    ReplyDelete