Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: How-to: Use your router as a BitTorrent Client

  1. #1
    Join Date
    Sep 2006
    Location
    Prishtina, Kosovo
    Posts
    56

    How-to: Use your router as a BitTorrent Client

    The main reason for me to choose for the Asus router was the BitTorrent client that was mentioned in several hundred reviews. However, as we all know, the one supplied by Asus is "less then perfect" and we still end up having to run our PCs 24x7 to get all those Linux distributions (or other type of downloads.... )

    Thanks to the excellent work of K.C. (kfurge), we’ve gotten a whole lot closer to this dream. Now we have a descent telnet service and the option to install packages. It is now possible to run a torrent client on our server!

    Several people already worked out how to get the below to work and hal2k1 already did quite a good job to explain how it’s done, but by putting it in the how-to section and explaining it in a bit more detail, it will hopefully be more accessible for other users as well.

    For this how-to, I assume that you have some basic Linux knowledge. Like the ability to start a program or to traverse through directories.

    So, that’s enough for an intro, now on to the interesting stuff:

    1. The first thing to do is install the 1.0.4.6 custom firmware on your router. K.C. already wrote a nice manual for that. Start reading here: http://wl700g.info/showthread.php?t=7109

    2. Telnet into your router (if you didn’t already do that)

    3. Now you have all that running you’ll need to install 2 more packages: “screen” and “enhanced-ctorrent”.

    Before you install these 2 programs, let me explain what they do:

    The screen program is a virtual telnet session to your router. A bit like terminal services on Windows, but then textual based. So you can start a program inside this virtual telnet session, logout and later resume the session (even from another computer). The screen program has been around for a long time and is used for programs that need a long time to run like compiling a big program or to analyse SETI-data. The BitTorrent client is in the same category: It doesn’t require much interaction with the user, but from time to time you want to see the progress.

    The enhanced-ctorrent client is a variation on the ctorrent program. The ctorrent program is actually the program that our ASUS router was using. This program was ok for it’s time, but the project is now asleep. Logically the enhanced version is better and still maintained so a much better way to go.

    Now you know the 2 programs, it’s time to install them:

    4 . The command for this is:

    ipkg install screen
    ipkg install enhanced-ctorrent

    Testing the screen program:
    Now you have the programs installed, you can try out the screen program. To start it, just type “screen” (without the quotes). As you see, the program simply starts with a fresh screen in your telnet session. Type a simple command like “ls”, just to get something on the screen.

    Now press ctrl+d and ctrl+a

    You should now see on your screen “[detached]” and the prompt again. Now you type exit to close your telnet session.

    Start again your telnet session and logon to your router. Now type “screen –r” (the R stands for resume) to resume an earlier screen session.

    As you can see the output of your earlier ls command is still there, including all the settings etc. So by pressing ctrl+d and ctrl+a again, you’ll detach the screen and “screen –r” you get back to it. If you don’t need the virtual screen anymore, you can simply type “exit” when you are inside the virtual screen and the virtual screen will stop (so no more screen to resume to).

    I hope that the above makes it clear how the screen program works and how it is useful for all kind of long running programs.

    Testing the enhanced-ctorrent program:
    Before we can test this program, we’ll need a torrent file. To test this, find a torrent file that points to something popular and small. Ebooks are usually a good one to use. Download the torrent file with your webbrowser and place it somewhere on your router shared directories.

    For example, place the file here: \\WL700gE\Myshare1\Download

    (I assume that you are still logged into your router via telnet).

    Go to that same directory: cd /shares/MYVOLUME1/MYSHARE1/Download

    The enhanced-ctorrent program doesn’t need any complicated parameters to start.

    Just type “enhcanced-ctorrent filename.torrent” and the download will start.

    The first thing it will do list the content of the torrent file: Which files does it contain.
    For all these files it will reserve the space already on your router. If you download for example an ISO file of a DVD, a 4gb file will be made in your hard drive, but will not actually contain anything yet.

    At the bottom of the screen, you’ll see something like this:

    Already/Total: 0/9 (0%)
    Listening on 0.0.0.0:2706

    So, you’ve already downloaded 0 of the 9mb of the file (since you just started with it) and that the program is listening on that port for clients.

    The next line will be something like:

    \ 0/18/0 [1/719/686] 0MB,0MB | 0,0K/s | 0,0K E:0,1

    Have a look here (http://www.rahul.net/dholmes/ctorrent/userguide.html) for more details on what this exactly means, but it will give you very basic information and see that the download is in progress. The first character changes from / to – to \ to | just to give you a limited indicator that the process is still alive.

    Like most torrent downloads, they seem to work best if you don’t look at them, this is where the screen program comes in.

    For now, just press ctrl+c to stop the torrent client. You will now have your prompt again.

    Start the screen program and now start the enhanced-ctorrent program again with the same command as before.

    The first thing the torrent client will do is to check the file that was earlier downloaded. You’ll see something like this: “Check exist: 3/9”.

    Once the entire check has been completed, it will resume the download and will show something like this:

    Already/Total: 3/9 (33%)
    Listening on 0.0.0.0:2706

    The download continues now until it’s completed. Once that is done, it will tell you that on the screen and will still continue to seed for 72 hrs. After that point the program will automatically exit.

    You can change the way the enhanced-ctorrent client works with a couple of parameters, this page (http://www.rahul.net/dholmes/ctorrent/userguide.html) will give you the parameters. Specially the upload and download limits would be useful. For example, adding “-U 15 –D 60” will limit your upload to 15 KB/s and download to 60 KB/s.

    I hope that you understand how using this program together with screen will help you download stuff on your router without your PC running.

    I know it’s not as nice and fancy solution as a program like utorrent or Azureus, but it does the trick.

    Good luck with the download and let me know if I forget to include something in this here.

  2. #2
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    190

    Thumbs up connectable

    First of all thanks for writing this How To:

    And to all who are making this beautifull white box into a monster ... You are doing a hell of a great job

    I have a little problem with my firewall...
    when I disable the firewall on the webpage all is going great
    when I enable the firewall and set portforwarding 2700:2710 --> 192.168.1.1(Router) It gives me a error in enhanced-ctorrent because I'm downloadin from private trackers and they can't connect to me so can't downlaod from them

    My question is how to set up my firewall correct in this beast so everything is protected

    Grtzz
    Ron


    (EDIT) did someone already testet how many torrent's can be ran at the same time ??
    I'm currently running 6 torrents all is going well ad my box makes a lot of noise AND fast speeeeeeeds
    Last edited by back2basic; 05-01-2007 at 14:57.

  3. #3
    Quote Originally Posted by back2basic View Post
    I have a little problem with my firewall...
    when I disable the firewall on the webpage all is going great
    when I enable the firewall and set portforwarding 2700:2710 --> 192.168.1.1(Router) It gives me a error in enhanced-ctorrent because I'm downloadin from private trackers and they can't connect to me so can't downlaod from them
    Isn't it better to OPEN the ports to your WAN address than to forward them to the LAN?

    see my other post in iptables topic, but generally
    iptables -I INPUT 7 -p tcp --dport 2700:2710 -j ACCEPT
    should do the job for 2700-2710 work

    Anyway, due to masquerade is could work also with FW on and no port open

    BTW: enhanced-ctorrent uses 2706-2106 as default

    Unofrtunately, I am almost unable to get any download to reasonable speed (5-10 times slower than utorrent behing the router) - even disabling the firewall does not work :-(

  4. #4
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    190
    thx It worked
    my download is only 2-3 times slower than utorrent

    Openwrt or Custom Firmware on asus? - http://wl700ge.hezik.nl/ - Http://wl700g.homelinux.net

    My ASUS collection: WL500gp(80GB usb-hdd - Running OpenWrt Kamikaze 7.09) | WL700gE(250GB - Running OpenWrt Kamikaze 8.09rc1)

  5. #5
    Quote Originally Posted by back2basic View Post
    thx It worked
    my download is only 2-3 times slower than utorrent
    I'm not downloading that much to check - but I suspect that utorrent DHT feature makes the difference (it sees much bigger number of peers). As my line speed is 10Mbit symmetrical it can boost the DL speed to over 500kbit/s with some torrents whereas enhanced-ctorred gets maximally 60-70.

    Other reason could be the torrents/trackers I'm downloading from - usually public with few seeds/peers (I guess that's where DHT helps utorrent to find other peers/seeds).

  6. #6
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    190
    as I mentioned before I only download from private trackers so I have DHT always disabled
    My line speed is adsl2+ max20Mb a good 1600KB down and max 120KB up
    when I download on my pc I gat a speed of 1000 down agains 55 up
    but when I download with my router the speed is changing to 700 down and 250 up... How can my router upload @ 250 when my max up speed is 120

    Grtzz

    Ps sorry for the chrappy english (I'm dutch)

    Openwrt or Custom Firmware on asus? - http://wl700ge.hezik.nl/ - Http://wl700g.homelinux.net

    My ASUS collection: WL500gp(80GB usb-hdd - Running OpenWrt Kamikaze 7.09) | WL700gE(250GB - Running OpenWrt Kamikaze 8.09rc1)

  7. #7
    Join Date
    Dec 2006
    Location
    Killa Cali
    Posts
    2
    Probably has to do with how many connections the router can handle at any given time. DHT can help but it wont matter if the client/router can't connect to atleast 50-100 peers if there is that many in the swarm.

  8. #8

    Question

    Hi,

    I keep getting the same error when trying to download torrent file.

    "segmentation fault"

    What's happening ?

    Thanks !

  9. #9
    Here is are 2 dumb question:
    1. Since enhanced ctorrent seems to be command line compatible with the asus ctorrent program, why not just replace the ctorrent executable in the custom firmware with your enhanced ctorrent version? That way the asus utilites should work together with the improved torrent client?

    2. OR install enhanced ctorrent to the opt directory and change the name to ctorrent. That way if the system finds this ctorrent before the built in asus version it will use the fixed version without the file size limitation?

  10. #10
    Join Date
    Jan 2007
    Location
    Cph, Denmark
    Posts
    38
    Quote Originally Posted by qz3fwd View Post
    Here is are 2 dumb question:
    1. Since enhanced ctorrent seems to be command line compatible with the asus ctorrent program, why not just replace the ctorrent executable in the custom firmware with your enhanced ctorrent version? That way the asus utilites should work together with the improved torrent client?

    2. OR install enhanced ctorrent to the opt directory and change the name to ctorrent. That way if the system finds this ctorrent before the built in asus version it will use the fixed version without the file size limitation?
    Sounds like a great idea! I prefer using the shell though.

  11. #11
    When i open my torrent and stuff, everything works, but i ain´t getting any status or shit...actually i don´t even know if my enhanced torrent is downloading ^^ Kinda like that (the Screen): http://home.mnet-online.de/luckynuts/torrent.JPG

  12. #12

    problem "segmentation fault" why?

    Hi,

    I keep getting the same error when trying to download torrent file.

    "segmentation fault"

    What's happening ?

    Thanks !

  13. #13
    Join Date
    Sep 2006
    Location
    Prishtina, Kosovo
    Posts
    56
    Quote Originally Posted by luckynuts View Post
    When i open my torrent and stuff, everything works, but i ain´t getting any status or shit...actually i don´t even know if my enhanced torrent is downloading ^^ Kinda like that (the Screen): http://home.mnet-online.de/luckynuts/torrent.JPG
    Sorry. I have not encountered that error message before yet. Maybe the webpages for the enhanced-ctorrent client will give you an answer on it?

  14. #14
    hey guy´s i checkt on that error message a lot people get when they try to download stuff with ctorrent. I sent a email to one of the guy´s who made that programm. To get all the answeres they need to help us, I need the help of you guy´s who implemented that programm in the firmware. Here you go with the stuff they need:

    Email:
    > > hi,
    > > i checked out your programm (enhanced ctorrent) well, when i tryed do
    > download a file, i typed in like enhanced-ctorrent filname.torrent it shows
    > me all of the file info, but no progress or stuff. on the very button it
    > shows this message: "Segmentation fault" (i made a screenshot of it:
    > http://home.mnet-online.de/luckynuts/torrent.JPG ) Why doesn?t it download or stuff?
    > >
    > ------------------------------------
    > First, please verify that you're using release dnh2.2 (the first line
    > of output when running ctorrent with no parameters will indicate the
    > version); versions prior to dnh2 could not handle torrents over 4GB.
    > Also let me know what parameters (options) you are using.
    >
    > Assuming you're on dnh2.2, we'll need to try to get some debugging
    > information. Please insure that your ctorrent binary has not been
    > "stripped"; a 'make install' or package installation may do this.
    > The binary should be around 350K. If it is significantly smaller,
    > recompile the program and copy "ctorrent" from the work directory
    > rather than performing an install.
    >
    > When the problem happens, you should get a core dump; run a gdb
    > backtrace on it, as follows. You'll likely need to specify the
    > full path to ctorrent, and the path and name of the core file if
    > not in the current directory.
    > 1. $ gdb -se ctorrent -c *.core
    > 2. (gdb) bt
    > 3. (gdb) quit
    >
    > Please send me a copy of the output from the "bt" command (cut and
    > paste is fine). Keep a copy of the ctorrent executable and the core
    > file if possible in case some additional information is needed.
    >
    > +----------------+-----------------+----------------------------------+
    > | Dennis Holmes |dholmes@rahul.net| "We demand rigidly defined areas |
    > | San Jose, CA +-----------------+ of doubt and uncertainty!" |
    > +----=>{ Meanwhile, as Ford said: "Where are my potato chips?" }<=----+

  15. #15
    im not sure but do you start the torrent with "enhanced-ctorrent torrentfilename.torrent" instead of "ctorrent torrentfilename.torrent" ?

    and is this error also with files < 2 gb?

    grat182

Page 1 of 2 12 LastLast

Similar Threads

  1. router cannot reconnect with PPPoE
    By gstadler in forum WL-500gP Q&A
    Replies: 1
    Last Post: 11-06-2007, 20:51
  2. Replies: 6
    Last Post: 12-11-2006, 23:41
  3. Firewall dies
    By confused in forum WL-500g Q&A
    Replies: 0
    Last Post: 04-11-2006, 19:09
  4. I'm getting a bit fed up with this router
    By ralam in forum WL-700g Q&A
    Replies: 1
    Last Post: 18-08-2006, 21:04
  5. Completely new WL700gE router crashed after firmware update - plz help!
    By ClaudeX in forum WL-700g Firmware Discussion
    Replies: 4
    Last Post: 20-07-2006, 01:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •