User Guides Step by Step guide to setting up Buffalo router into a torrent downloader & NAS box

I have been using the Linksys 610N as a torrent downloader plus wireless router for the past year and while I was happy with the router, there are a few things that were bugging me. One was the NAS speeds to copy the downloaded torrents to my PC. I would hardly get 3mbps. I have also tried the Asus W500g and that was also a broadcom chipset and it was more limited than the Linksys.

So I decided that I would give a try for the Atheros wireless chipset. I shortlisted and got the Buffalo WZR-HP-G300NH router for INR 5k. It is a sleek black router with nice antenna's, fantastic wireless range, gigabit ports, a 400MHz processor, 32MB flash, 64MB RAM and a USB port.

The biggest stumbling block with the Atheros chipset was the fact that DD-WRT had limited support for packages on this chipset. The reason being that the Atheros CPU in the Buffalo router is MIPS while the Broadcom routers like Linksys 610N are MIPSEL. In laymans terms, it means the popular optware packages in DD-WRT compiled for broadcom will not work on this router. I installed dd-wrt and the openwrt packages using a lot of hacks documented on the web and most things did work. Then I started discovering issues, the primary one being there is no large file support in the firmware, so any downloaded files over 2gb would not even be visible on the Samba share.

This left me with the last option, install OpenWRT on the router. Information on OpenWRT is sadly less than for DD-WRT, there are lots of scattered information all over the net, but no consolidated place. Anyways, once I finished the setup, I was pleasantly surprised by the performance of NAS and the wireless ! I easily get over 7mbps to read files off the NAS connected to the WZR-HP-G300NH and the wireless range is fantastic. It also seems to draw less power than the Linksys (3watts as compared to 7watts for the Linksys).

Since I struggled for over a week to get everything working, I decided to document the procedure. Here are the exact steps to setup and configure the Buffalo WZR-HP-G300NH with OpenWRT to act as a wireless router, NAS and torrent downloader.
Remember a few ground rules.

1. Rule one, make sure that all the features of the router works in its default firmware before you move further. If there is a issue with the hardware, you do not want to find out after you have voided the warranty.

2. On the warranty front, OpenWRT is not a supported firmware for the Buffalo, so you might need to move back to the official firmware if there is ever a need to open a warrarty request. Do not blame me if you end up messing everything and cannot revert for some reason.

3. The router is virtually un-brickable as it has TFTP support in its bios. So you can almost always recover in any worse case scenario. Just make sure you have a Linux machine or LiveCD that can be used to update the firmware with TFTP.

4. Have a UPS connected to the router when upgrading. Power cut halfway through a upgrade is one way to void point 3. This router takes almost 5 minutes for a flash update and goes through multiple boots. Never do anything with the router till the red diagnostic LED stops flashing and the green LED come on solid. Get some popcorn if you do not have patience !!!

5. Make sure you have the Indian (B0 C0) or a non Japanese version of the router. This 4 digit code is printed on the router itself above the default SSID (unfortunately no way to figure this out unless you open the box. But if you are buying from a dealer in India, you will not get the Japanese version). If you have a Japanese version (A0 A1 or A0 A3), STOP right now and read this link , there are lots of complications with the Japanese router upgrade.
Here goes:
1. Download the latest "buffalo_to_ddwrt_webflash-MULTI.bin"

Pick on the latest date in the ftp link, move to the buffalo_wzr-hp-g300nh folder to get your file.

ftp://dd-wrt.com/others/eko/BrainSlayer-V24-preSP2/

I particularly used the file from this link for my work.

Note : There is a easier way to directly move to OpenWRT using the TFTP method as described in the last section, but I will use the easy method, even if it means three firmware flashes !!!


2. Connect to 192.168.11.1 with your browser and go to the firmware update page.


Choose the file you downloaded in step 1 and wait till the router is flashed fully.

Note : I will be referencing 192.168.11.1 as the default router page. Sometime the default page could be 192.168.1.1. One of them will always work.
3. After the reboot, if you again go to the router homepage via your browser, you should now see the DD-WRT webpage.

Change the admin password so that you can use ssh and login using the same password you just set.
4. Login to the router via ssh (Can use putty.exe)

Run these commands :

cd /tmp
wget http://downloads.openwrt.org/backfi...wrt-ar71xx-wzr-hp-g300nh-jffs2-sysupgrade.bin
mtd -r write openwrt-ar71xx-wzr-hp-g300nh-jffs2-sysupgrade.bin linux

Note : As of now, 10.03.1-rc4 is the latest, always go for the latest version you find.

Wait for a full 6-9 minutes before you do anything. When the router comes up again, you should have OpenWRT running.
5. Run the following commands one by one to install all the USB and file system drives :

opkg update
Make sure this command above completes. If there is a issue with your network, the update will fail. Fix this before you move ahead.


opkg install kmod-fs-btrfs kmod-fs-ext2 kmod-fs-ext3 kmod-fs-ext4 kmod-fs-isofs kmod-fs-reiserfs kmod-fs-vfat kmod-fs-xfs

opkg install kmod-nls-cp1250 kmod-nls-cp1251 kmod-nls-cp437 kmod-nls-cp775 kmod-nls-cp850 kmod-nls-cp852 kmod-nls-cp866 kmod-nls-iso8859-1 kmod-nls-iso8859-13 kmod-nls-iso8859-15 kmod-nls-iso8859-2 kmod-nls-koi8r kmod-nls-utf8

opkg install kmod-usb2 kmod-usb-storage kmod-usb-storage-extras block-hotplug block-mount hotplug2

6. Connect a USB drive to the router and reboot.


Im going to assume that there is a external drive connected with a single partition formatted to ext3. If you need more partitions or a different file system, you probably know what you are doing, so tweak the commands !!!
7. The next set of commands are a safety net.

If you ever bootup without the USB drive connected, you might end up writing to the router flash and mess things, so the command below will make sure you cannot write anything to the share if the drive is not mounted.

mkdir /mnt/download -p
touch /mnt/download/WARNING_USB_DRIVE_IS_NOT_MOUNTED
chmod 444 /mnt/download -R
8. Run the following commands to setup the first partition to be mounted automatically :

uci set fstab.@mount[0].target=/mnt/download
uci set fstab.@mount[0].device=/dev/sda1
uci set fstab.@mount[0].fstype=auto
uci set fstab.@mount[0].enabled=1
uci set fstab.@mount[0].options=rw,sync,noatime,nodiratime
uci commit fstab

Reboot the router
9. Run the following commands to install samba3:

cd /mnt
chmod 777 download/
cd download/
mkdir -p /mnt/download/downloads
mkdir -p /mnt/download/torrents
chmod 777 downloads torrents

opkg update
opkg install samba3 luci-app-samba

uci set samba.@samba[0].name=Buffalo
uci set samba.@samba[0].description=Buffalo
uci set samba.@samba[0].workgroup=WORKGROUP
uci set samba.@sambashare[0]=sambashare
uci set samba.@sambashare[0].guest_ok=yes
uci set samba.@sambashare[0].path=/mnt/download/downloads
uci set samba.@sambashare[0].name=download

uci commit samba
10. Samba3 is now installed. Time to configure it.

Edit the file : /etc/samba/smb.conf.template

Add the lines :
force user = root
writeable = Yes
create mask = 0777
directory mask = 0777
inherit permissions = Yes​

Remove the line:
invalid users = root​
11. Run the command to start samba :

/etc/init.d/samba restart

At this point, use explorer to goto \\192.168.11.1 to make sure the samba share is accessible and writable.
12. Time to install transmission for the torrent downloads.

Run the following commands :

opkg install transmission-web
transmission-daemon -g /mnt/download/torrents
killall transmission-daemon
cd /mnt/download/torrents
cp settings.json settings.json.copy
13. Time to configure transmission startup :

Replace the contents of the file /etc/init.d/transmission with the text below :

#!/bin/sh /etc/rc.common

START=99

start(){
cp /mnt/download/torrents/settings.json.copy /mnt/download/torrents/settings.json
transmission-daemon -g /mnt/download/torrents
}

stop(){
killall transmission-daemon
}
14. Edit the file /mnt/download/torrents/settings.json.copy and replace all the content in the file with these lines below :
{
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 2,
"dht-enabled": true,
"download-dir": "/mnt/download/downloads",
"encryption": 1,
"incomplete-dir": "/mnt/download/incomplete-torrents",
"incomplete-dir-enabled": false,
"lazy-bitfield-enabled": true,
"lpd-enabled": false,
"message-level": 2,
"open-file-limit": 32,
"peer-limit-global": 240,
"peer-limit-per-torrent": 60,
"peer-port": 55555,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": 0,
"pex-enabled": true,
"port-forwarding-enabled": true,
"preallocation": 1,
"ratio-limit": 2,
"ratio-limit-enabled": true,
"rename-partial-files": true,
"rpc-authentication-required": false,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "{414db619f34798e4204bce201b584670afd2795ax7vJCOc.",
"rpc-port": 9091,
"rpc-username": "",
"rpc-whitelist": "*",
"rpc-whitelist-enabled": true,
"speed-limit-down": 1000,
"speed-limit-down-enabled": true,
"speed-limit-up": 100,
"speed-limit-up-enabled": true,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 0,
"upload-slots-per-torrent": 14
}

If you know what you are doing, feel free to change any of the values above to change the behavior of your torrent downloader.
15. Run the command below to make transmission auto start with the router :

cd /etc/init.d; chmod +x transmission; ./transmission enable
16. Reboot the router and browse to : http://192.168.11.1:9091

You should see the transmission webpage from where you can add and control all torrent downloads.

:clap:
That is about it. Add torrents, let the router download all night, then use samba to copy the downloaded file to your machine !!!

Have fun downloading and NAS'ing

:clap:


If you mess up with the steps and your router stops responding : :
:mad:

1. Boot into linux on the PC (LiveCD will work well), typically Ubuntu 10.10. Connect the PC network cable to the lan port closest to the blue WAN port. Switch OFF the router.


2. Run the following commands (substitute the XX:XX with your router's MAC ID which is printed on the box):

ifconfig eth0 192.168.11.2 netmask 255.255.255.0
arp -s 192.168.11.1 xx:xx:xx:xx:xx:xx

3. Now run the tftp command and enter the commands under it one by one,
tftp 192.168.11.1
binary
rexmt 1
timeout 60
trace
put openwrt-ar71xx-wzr-hp-g300nh-jffs2-tftp.bin

4. Now turn on the power to the router even as the command above is running.
The TFTP command would timeout a few times and will start the process as soon as the router is turned on. Wait for a full 10 minutes after the tftp command returns (yes, it takes that long !) and you should be back up and running.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

Awesome, BTW DDWRT has official support on these routers right? The why the issues?
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

axeman said:
Awesome, BTW DDWRT has official support on these routers right? The why the issues?

I bought the router thinking the same till I figured out there is always more to the story !!! DD-WRT will install and work perfectly if all you want is a router for wireless access, the problem is with the optware packages like transmission which not compiled/available for the Atheros chipset in dd-wrt. The packages compiled for broadcom will not work on this router.

So you end up installing DD-WRT and then hashing together some packages like transmission from the openWRT world using opkg. This leads to a lot of issues, prime among them being lack of large file support.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

can someone post the guide for configuring WL 520gu router using Olegs/DD WRT for torrent downloads?
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

Any ways for me to increase the Speed for Belkin PlayMax Wireless Router, the same speed of max 3mbps am getting while copying the downloaded contents from the attached USB to PC :( Techs please help me with it....
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

Awesome.

Now you will make me sell my Asus N13U (crap inbuilt torrent down loader)& take this buffalo router :)
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

I have been using dd-wrt + opt-ware on my ASUS RT N13U (old one(4MB Flash+32MB RAM), not rev B1(64MB RAM)) for a long time. Let me know If you are interested in learning more.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

Im not sure who you are addressing here. (It is a good practice to quote the post when you want to address someone specific in a thread). I personally have been using DD-WRT every since the early days, so Im all set.

doofy.dog said:
I have been using dd-wrt + opt-ware on my ASUS RT N13U (old one(4MB Flash+32MB RAM), not rev B1(64MB RAM)) for a long time. Let me know If you are interested in learning more.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

I apologize for the incorrectly placed post. My post was supposed to be a reply to the message posted by @Praks.

Thank you for sharing your knowledge with us.

vinayaga said:
Im not sure who you are addressing here. (It is a good practice to quote the post when you want to address someone specific in a thread). I personally have been using DD-WRT every since the early days, so Im all set.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

Great Guide , so what according to u would be a better router which would help me full explore the capabilities of DDWRT.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

doofy.dog said:
I have been using dd-wrt + opt-ware on my ASUS RT N13U (old one(4MB Flash+32MB RAM), not rev B1(64MB RAM)) for a long time. Let me know If you are interested in learning more.
Hey bro, Let me know if you have any process to upgrade DD WRT on rev B1.

Let's not jump into this awesome guide thread. Pls PM me directly.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

The ASUS RT-N16 and Linksys 610N / Linksys E3000 (old name / new name) are two of the best routers that I have used with Broadcom chipsets for pure DD-WRT joy. Plenty of RAM and ROM and reasonable range and stability.

Quad Master said:
Great Guide , so what according to u would be a better router which would help me full explore the capabilities of DDWRT.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

vinayaga said:
The ASUS RT-N16 and Linksys 610N / Linksys E3000 (old name / new name) are two of the best routers that I have used with Broadcom chipsets for pure DD-WRT joy. Plenty of RAM and ROM and reasonable range and stability.
Thanks , how is the Neatgear WNDR3700
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

Well done buddy. A very nice and detailed guide.
Thanks.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

Found another nice little feature in OpenWRT that increase the life of the hard drive by making it sleep after 5 minutes of inactivity !

Run these commands:

opkg update

opkg install hd-idle luci-app-hd-idle

uci set hd-idle.@hd-idle[0]=hd-idle

uci set hd-idle.@hd-idle[0].disk=sda

uci set hd-idle.@hd-idle[0].idle_time_unit=minutes

uci set hd-idle.@hd-idle[0].idle_time_interval=5

uci set hd-idle.@hd-idle[0].enabled=1

uci commit

opkg install of the luci component might return a few errors, just ignore them and reboot. The hard drive will spin down after 5 minutes of inactivity and will come up automatically when accessed.
 
Re: Step by Step guide to setting up Buffalo router into a torrent downloader & NAS b

very good guide, need some suggestion on buying one router for my self just to use for downloading to my hdd (transend usb casing)
1. i not a geek , so something simple but should not cost a bomb...
2. intend to use like 24X7 (so power consumption , how much it is compare general computer)
3.cost factor....

please suggest something which i can use,,,thanks in advance
 
Back
Top