This post is also available in: Italian

---
Introduction
If you have read my previous article (DD-WRT come Home Server – Parte 1) you know how, with relative ease, it is possible to “trasform” a good quality home router into a real Home Server that can share files, music, pictures and videos in vitually every corner of your house and on many devices.
In the first article however, we only explored (very) few of the many possibilities of DD-WRT; in this article we will dig into the Linux system the powers DD-WRT and we will see hot to use our router to the maximum. The purpose of this guide is to install a BitTorrent clinet on the router, setting the foundation needed for more customization.
1.1. Warning!
While the first article was aimed at anyone and required only a little familiarity with the use of computers, this guide is quite technical and requires some “know-how”.
You don’t need to be an expert in IT, but some knowledge of the Linux command line is essential, since most of the work will be with scripts and text commands, but I think that the results will be more than worth.
If you have no idea of what “mounting” or “unmounting” a disk in Linux means, or how to use simple commands such as “cp” or “chmod” and if you have never used the “vi” text-editor, then this guide is not for you.
Additionaly, all the steps are based on the assumption of using a Netgear WNR3500Lrouter with the DD-WRT Kong Mod, installed following the instructions of my previous article. All the steps, commands and scripts provvided are 99% compatible with any other router with a USB port and able to run DD-WRT, but adapting them requires at least a basic knowledge of shell script programming. I will try my best however, to indicate when changes are needed for compatibility with other routers.
Even if you know Linux but do not have the same router or version of DD-WRT used here and if you don’t know how to adapt the scripts, do not follow this guide!
Don’t get scared though, despite all the warnings and the nerd-jargon, this is very common and well documented Linux stuff, that doesn’t require years of study to learn, it just takes a bit of time and will to learn.
If you are new to linux and want to learn I suggest you try Ubuntu, one of the most used distributions. It is a great alternative to Windows, and it is also very easy to use!
1.2. Purpose of the guide and references
By the end of the guide our cheap router (you can find it at amazon.com for less than 70$: Netgear WNR3500L) will be able not only to share files and media with Samba and DLNA (as seen in the first guide), it will also act as a BitTorrent client.
This means that the router will download any torrent files on his own (with no need to have a PC switched on), saving the data directly to the connected USB drive, which then we will be able to access from any PC in the house.
But why using the router with torrent?
All computers, even the smallest ones, consume a lot of electricity (just try to leave you PC constantly ON for 3 weeks in a row and wait for the bill), make noises and produce heat.
Our little router uses only a few watts, does not heat and it is virtually silent. Need to download huge amounts of data over a slow connection? No problem, the router is made to be left always on and even if you have in the same room where you sleep it is unlikely that it will bother you!
Leave it on downloading day and night and you will not even notice the difference on the bill and you will pollute much less!
And if you worry about the “electromagnetic waves” of the Wi-Fi, well, you can always disable it when you are not using it, even though I’d be much more worried about having a cell phone next to you bed at night
This guide is based on many other guides, manuals and posts from forums around the net, trying to unify and (hopefully) improve the collected info.
Most of the info are taken for the following two articles:
The latter in particular will be “copied” here, using the same steps and script for the installation of a basic optware system.
These guides, however, have several problems:
- The first (Optware, the Right Way) makes you install a lot of software that, in our case, is either not needed, already built-in into the”Kong Mod” firmware (like Samba3) or that have no reason to be on a “simple” Home Server. Also, a script that tops your router for a good 10 minutes makes me shudder!
- The second (Transmission daemon), as functional as it is, seems more of a very basic “draft” to me. You have just some basic steps for the install and a “thrown in” configuration, with not explanations whatsoever on some questionable choices such as:
Using a single partition with a dual mount of “/opt” and “/mnt”; never a good pratice…
Putting all the daemon’s config files into “/mnt/data” (what is wrong with “/opt/etc”? That is the reason it exists…)
Changing the port for Transmission from 51413 to 25000 without giving any explanation why… - Both guides assume that you will always want/can telnet/ssh into the router to shut it off or remove the disk…
Therefore this guide will be:
- Essential, yet complete. We will install a system open to further improvements but we will only install the Transmission Daemon here, and concentrate on that.
- User-Friendly. We might not always have the need to share files on our network or to download with torrent, right? Therefore why not turning the disk off? It will save power (even if little) and extend the life of the disk itself. With my system we will only need to press the “WPS” button of our Netgear router and the disk will be unmounted automatically, no need for a PC to be on or for a console connection!
- Light on the router. Even if we have Samba3 and DLNA on the router’s firmware there is no need to leave them running when the disk is not connected; after all if there is nothing to share we cannot do much with them. The scripts on this guide will make sure that these service are loaded only when the disk is mounted and unloaded when the disk is removed, saving memory when needed.
I do not mean to say that my guide is the “ultimate” guide or that it is perfect; I am sure there is plenty of errors and improvement to be made (I already know a few); please let me know how I can improve it, I will be pleased!
English
Italiano