Saturday, July 16, 2011

BitTorrent Client: Transmission on DD-WRT

If you've followed the previous guide to set-up the opkg system, then installing transmission on the system is a no-brainer. The configuration and system set-up can be a bit more difficult, but not bad at all. We will install the Transmission daemon, web access, and remote access. Optionally, you can grant WAN access and user/password security. Let's get started.


  1. Install transmission
    To do so, log in and run the command:

    opkg install transmission-web

    This will install libevent (required library) transmission-daemon (the actual program) and transmission-web (the web interface).

  2. Setup transmission
    Run:
    transmission-daemon

    wait for 10 seconds then stop it:
    killall transmission-daemon

    This will create default configuration file for transmission, the file is located at /mnt/root/.config/transmission-daemon/settings.json

    Edit this file with following (delete all previous contents):

    {
    "blocklist-enabled": 1,
    "download-dir": "\/mnt\/share\/torrents",
    "download-limit": 100,
    "download-limit-enabled": 1,
    "encryption": 2,
    "max-peers-global": 35,
    "peer-port": 25000,
    "pex-enabled": 1,
    "port-forwarding-enabled": 1,
    "rpc-authentication-required": 0,
    "rpc-password": "",
    "rpc-port": 9091,
    "rpc-username": "",
    "rpc-whitelist": "192.168.1.*",
    "upload-limit": 200,
    "upload-limit-enabled": 1
    }


    The above is taken from the DD-WRT wiki with some modifications.

    Also create a download folder where the red part is your preferred directory:
    mkdir -m 777 /mnt/share/torrents

    So now all configuration files for transmission are in /mnt/root/.config. Downloaded files will be in /mnt/share/torrents.

    Open the port through the firewall, since UPNP will not open it for you. Command:

    /usr/sbin/iptables -I INPUT 1 -p tcp --dport 25000 -j logaccept

    You can change the port in the config file and firewall command to whichever you please.

  3. Set web access to transmission
    This is usually not a problem, however, in our setup, the web pages is are in a non-standard location. So we must make transmission aware of the change.

    To do so, a variable must be set for transmission. Run the commands below:

    export TRANSMISSION_WEB_HOME='/opt/usr/share/transmission/web/'
    transmission-daemon

    Now access the transmission web manage interface at http://192.168.1.1:9091/ (change the IP according to your router.

    If you want to access the web interface from outside your LAN, you have to open the webui port, and enable user log in.

    Open the port:

    iptables -I INPUT -p tcp --dport 9091 -j logaccept

    Set the user and password. This will be enabled for local and remote access. Unfortunately it is either on or off; you can't have it on for remote, an off for local.

    transmission-daemon -u user
    transmission-daemon -v pass


  4. Run it as service
    Just add the following line to /mnt/root/.profile:
    export TRANSMISSION_WEB_HOME='/opt/usr/share/transmission/web/'

    Then create the startup script /opt/etc/init.d/transmission (delete all previous contents if its not empty). This will add a pre-filled block list and run the program. Fill with:

    ######### START FILE ########

    #!/bin/sh

    #update blocklist
    cd /mnt/root/.config/transmission-daemon/blocklists/

    wget -q http://download.m0k.org/transmission/files/level1.gz
    if test -f level1.gz; then
    rm level1
    gunzip level1.gz
    chmod go+r level1
    fi

    source /mnt/root/.profile

    if [ -n "`pidof transmission-daemon`" ]; then
    kill -9 `pidof transmission-daemon`
    fi

    sleep 2
    transmission-daemon -b -g /mnt/root/.config/transmission-daemon/
    #uncomment below for user-login, and comment/delete the line above
    #transmission-daemon -b -g /mnt/root/.config/transmission-daemon/
    #transmission-daemon -u user
    #transmission-daemon -v pass
    #uncomment below for WAN web access
    #iptables -I INPUT -p tcp --dport 9091 -j logaccept

    ################## END FILE ########################

    Set it to run as service:
    chmod a+x /opt/etc/init.d/transmission
    ln -s /opt/etc/init.d/transmission /opt/etc/init.d/S60transmission

  5. Optional: Install a remote daemon ///COMING SOON///

1 comments:

Thank you sir.This work for my Tp-link wr1043nd r14929

Post a Comment

Note: Only a member of this blog may post a comment.