PDA

Bekijk de volledige versie : BTget howto?



Michiel
14-03-2006, 13:15
Hello guys,

i've set up my wl500g (Standard) and installed all the torrent packages including the .cgi script mady by Oleo..

But now my question: how can I start a torrent? I downloaded a torrent file, but I don't know how to start it and where to store it..

And is it nescesary to keep the telnetsession running??

Michiel
15-03-2006, 09:44
Is there no one who can help me?

I'm a real newbee in Linux and managed to do all the installation myself..

But how can i download a torrent to a specified directory on my harddisk?

:cool: yes i know i have to do it with btget, but how?:confused:

oleo
15-03-2006, 11:46
You must create directories

mkdir /tmp/harddisk/torrent
mkdir /tmp/harddisk/torrent/target
mkdir /tmp/harddisk/torrent/work
mkdir /tmp/harddisk/torrent/source


Then you save .torrent file into source (eg with samba share$)

Then you cah use command line

torrent_admin -lto list torrents. or -? for help.
or
torrent_watchdog to start processing!

Note that torrent_watchdog just looks over torrent processing. If some torrent dies it restarts it, or if torrent is finished then moves it into seeding queue or target. And if no torrent is currently processing it enqueues it into work queue. This means that torrent_watchdog should be run from cron (should suggested package. Corrected that in new ipk). Push is most usefull command as it pushes torrents from one queue to another.

Do you have questions about WWW cgi interface? But it seems to me that memory limitation os the standard 500g will be limiting multiple torrent processing as memory footprint of btget grows with number of active connections. For 70 peers it requires 16MB RSS RAM. Thats why Deluxe is a choice for such processing. I dont think thar ctorrent is any beter in memory requrements as it is written in C++.

Michiel
15-03-2006, 12:14
thanks for your reply... but is it nescesary to use /tmp/harddisk?

because i followed all the tuturials by macsat and so i have my harddisk mounted as /opt...
:rolleyes:

i have a huge swap partition of 1 GB.. is that enough to work with multiple torrents?

thanks again!

oleo
15-03-2006, 13:12
No it is not necessary to create on /tmp/harddisk but you should change /opt/etc/torrent.conf then to reflect your path settings. And report us how it performs on wl500g with swap. I have 512MB swap :) And usually I seed about 6 torrents and leech one or two.

Michiel
15-03-2006, 13:24
ok i think i started a torrent now but it is waiting to download?

so i wait till tonight.. then i let you know if it works..

greetz

Michiel
15-03-2006, 19:10
I am downloading a torrent now.. but i can't download a second torrent..

torrent_admin or torrent_watchdog then says: already an active torrent..

or is there another possibillity to run multiple torrents?

oleo
15-03-2006, 20:25
Normally you would have only one active torrent. Second will start after first will finish.
If you want to process two simultaneously use Push command. Eg.
torent_admin -l
torrent_admin -p torrent-number
if you are using command line. For CGI interface just select torrent with radio button and press Push.

Michiel
16-03-2006, 17:53
Hey Oleo,

I really appreciate your help! I think it is working now.. Yesterday I had a totall mess.. thttpd, btget, btlist etcetera didn't work anymore because they where linked against gnu license???

I removed everything and started over and now I also understand the commands you mentioned. First I had a total different torrent_admin!!

But now with my reconfigured system everything looks fine. I'm downloading 2 torrents simultanous and one is @ 40 % so looks reasonable...

Guess the standard wl500g is able to handle multiple torrents as long as you have enough swap :P..

Oh by the way i set the log_time in torrent.conf from 59 to 120 so they don't grow so fast...

oleo
16-03-2006, 19:45
Use Purge to clear finished and removed jobs. There is a bug in btget when emptz directory is going to be downloaded. Such torrent get stuck in retries and requires manual removal from work queue into target.

Michiel
16-03-2006, 23:19
:confused: i have this same problem again.. when i type 'btget' it returns:

btget: linked against GNU libc!

do you know what that means?

it happend after i used the torrent_admin -i command:confused: :confused:

oleo
17-03-2006, 07:31
It looks like you've got btget from unspecified location. Check package against

http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/

Anyway, On a fresh disk you should type:

[admin@oleo /]$ /usr/bin/ipkg.sh update
Downloading http://wl500g.dyndns.org/ipkg/Packages ...
Connecting to wl500g.dyndns.org[212.192.248.17]:80
Packages 100% |***********************************************| 754 00:00 ETA
Done.
Updated list of available packages in /opt/lib/ipkg/lists/wl500g
[admin@oleo /opt]$ ipkg.sh list
ipkg - lightweight package management system
[admin@oleo /opt]$ ipkg.sh install ipkg

Downloading http://wl500g.dyndns.org/ipkg/ipkg_0.99.149-2_mipsel.ipk ...
Connecting to wl500g.dyndns.org[212.192.248.17]:80
ipkg_0.99.149-2_mips 100% |***********************************************| 71113 00:00 ETA
Done.
Unpacking ipkg...Done.
Configuring ipkg...Done.

Then update again with:
[admin@oleo /opt]$ ipkg update
Downloading http://wl500g.dyndns.org/ipkg/Packages
Updated list of available packages in /opt/lib/ipkg/lists/wl500g
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/Packages
Updated list of available packages in /opt/lib/ipkg/lists/unslung
Successfully terminated.

Program listing with:
[admin@oleo /opt]$ ipkg list | more
abook - 0.5.5-1 - Abook is a text-based addressbook program designed to use with mutt mail client.
adduser - 1.00-4 - a multi-call binary for login and user account administration
adns - 1.1-2 - Asynchronous resolver library and DNS resolver utilities.
alac-decoder - 0.1.0-2 - A decoder for the apple lossless file format
antinat - 0.90-2 - Antinat is a flexible SOCKS server and client library for writing proxy-based applications.
apache - 2.0.54-2 - The most popular web server on the internet
apache-manual - 2.0.54-2 - Online documentation for the apache webserver
appweb - 2.0.5-7 - AppWeb is the leading web server technology for embedding in devices and applications. Supports embedded javascript, CGI, Virtu
apr - 0.9.6-2 - Apache Portable Runtime library
apr-util - 0.9.6-3 - Apache Portable Runtime utilities library
...

Then some basic commands:

[admin@oleo /opt]$ ipkg list | grep -i core
coreutils - 5.2.1-8 - Bunch of heavyweight *nix core utilities
libbt - 1.05-4 - a C library implementing the core BitTorrent protocol
[admin@oleo /opt]$ ipkg install coreutils
Installing coreutils (5.2.1-8) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/coreutils_5.2.1-8_mipsel.ipk
Configuring coreutils
update-alternatives: Linking //opt/bin/kill to /opt/bin/coreutils-kill
update-alternatives: Linking //opt/bin/uptime to /opt/bin/coreutils-uptime
Successfully terminated.
[admin@oleo /opt]$ ipkg install findutils
Installing findutils (4.1.20-3) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/findutils_4.1.20-3_mipsel.ipk
Configuring findutils
Successfully terminated.
[admin@oleo /opt]$ ipkg install findutils less nload
Package findutils (4.1.20-3) installed in root is up to date.
Installing less (381-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/less_381-2_mipsel.ipk
Installing ncurses (5.5-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/ncurses_5.5-1_mipsel.ipk
Installing nload (0.6.0-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/nload_0.6.0-2_mipsel.ipk
Installing libstdc++ (0.1.12-3) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/libstdc++_0.1.12-3_mipsel.ipk
Installing libuclibc++ (0.1.12-3) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/libuclibc++_0.1.12-3_mipsel.ipk
Configuring less
Configuring libstdc++
Configuring libuclibc++
Configuring ncurses
Configuring nload
Successfully terminated.

After that

ipkg install torrent

Michiel
17-03-2006, 11:29
well here we go!

Michiel
19-03-2006, 11:54
Well I'm back online! Everything is running now without any problems.
But I only download one torrent a time because otherwise my router gets very slow and then I cant browse the web anymore :rolleyes:

Oleo, thank you very much for your help!!

oleo
19-03-2006, 13:16
Enable wodnershaper or set UL/DL limits in firmware.

Michiel
20-03-2006, 17:54
I don't know where to find wondershaper.. but thanx

Another question.. is it wise to open the used bittorrent ports in the firewall? Because it looks like my torrent download speed is very low...:o

oleo
20-03-2006, 19:52
For wshaper ---> http://wiki.wl500g.info/

Sure you need to open ports.

Michiel
20-03-2006, 20:40
ok thank you..

so I forward the ports in webinterface -> virtual server. The ports that i set in my torrent.conf

am i right??

Michiel
24-03-2006, 22:15
looks like that doesn't work.. can someone please tell me how i open these ports for torrent??

thank you

oleo
27-03-2006, 07:46
The simplest way is to open ports with "Virtual server" where LOCAL_IP is local IP of your router and port range which you specified in /opt/etc/torrent.conf

Optionally you can open with:

iptables -A INPUT -i eth1 -p tcp --syn --dport 56881:56889 -j ACCEPT

You can enther this in /usr/local/sbin/post-firewall script where arguments are:
Code:


$1 = WAN interface
$2 = WAN IP
$3 = LAN interface
$4 = LAN IP


So the line should look like:


iptables -A INPUT -i $1 -p tcp --syn --dport 56881:56889 -j ACCEPT iptables -t nat -A PREROUTING -i $1 -p tcp --dport 56881 -j DNAT --to-destination $4:56881
...

Hellish
27-03-2006, 11:11
Helo everybody,

I was watching your conversation, because I needed to do the same thing and so I have everything installed and I think I still got my ports closed.
I created a virtual server to my router for the torrent ports with these settings:
Port range: 56881:56889 (as set in the torrent client)
Local IP: 192.168.10.1 (my routers' internal ip)
Local port: Empty
Protocol: TCP
Protocol No.: Empty
Description: Bit Torrent (to be complete :)

I still get many packets dropped as this one from my log:
Mar 27 11:53:44 kernel: DROPIN=vlan1 OUT= MAC=00:11:2f:16:7a:13:00:14:f1:d4:48:8d:08:00:45:2 0:00:30 SRC=200.250.242.248 DST=192.168.10.1 LEN=48 TOS=0x00 PREC=0x20 TTL=106 ID=4653 DF PROTO=TCP SPT=1684 DPT=56881 SEQ=663218928 ACK=0 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405B401010402)

So I would like to ask these questions:
A) Does the WAN and LAN Filter apply even if I have the virtual server set up? In other words do I have to set rules for the WAN&LAN Filter for the bittorrent to function?
B) Why is it so that even when I disable the LAN&WAN Filter some packets still get dropped by the firewall?
C) How can I make sure that all trafic on a port really gets to the router/bittorrent, becase the torrent is working and downloading, but at too slow rates and I am afraid it is because many packets are dropped.

Thatk you all for your help. I know many of you spend a lot of time helping people like me and I Appreciate your effort.

Hellish

oleo
27-03-2006, 20:32
If you are able to open ports to telnet then I see no difference for other TCP apps like torrent. I also suggest that you enable ping from internet. If everything fails, try disabling firewall.

Hellish
28-03-2006, 16:53
I did as you said Oleo (enabled ping and turned off firewall) and the quality of the upload goes up dramatically. The quality of the download didn't get much better, but I guess I cannot await very much from this mini torrent client. It's capabilities can't be compared to the thick clients on PCs. To recapitalize it I think when I enable the pings and disable the firewall the torrent client works as good as it can...
So all I need now is to reenable the firewall. Correct me please If I say something wrong:

1) I have to create a virtual server for the posts (in my case 56881:56889) and the local ip of the router (in my case 192.168.10.1) to forward the ports to the internet.
2) enable pings from the internet in "intenet firewall -> Respond Ping Request from WAN?" menu.
3) set WAN to LAN and LAN to WAN filters so they would keep securing other ports on the LAN.

in point 3 I still have a couple of questions:
a) do I have to make a WAN to LAN filter with the external IP (the IP I get from my ISP?) or is it enough to make a filter for the internal IP of the router (in my case 192.168.10.1)?
b) do I have to make a filter for the ping packets? could you please give me an example of such filter
c) in th LAN to WAN filters, do I have to make a filter from my internal IP of the router to my external IP of the router (IP from my ISP)? Or just for the internal router IP?

Thanks again for your help. I am having fun getting to know the router and I am even making my first steps in Unix/Linux systems so it is very interesting to discover new things with the help of this comunity:)

Hellish

Hellish
28-03-2006, 20:07
If you are able to open ports to telnet then I see no difference for other TCP apps like torrent. I also suggest that you enable ping from internet. If everything fails, try disabling firewall.
I access the telnetd only from LAN. I need to open the torrent ports to the internet. That is a difference or not? :confused:
I think I need to go and find myself a tutorial on the firewall :D

goos night for now...

I'll be back ;)

oleo
29-03-2006, 09:40
Practical memory limits are about 150 peers overall (up to 10 btgets). So it can be used for many purposes.

A1) Yes
A2) Yes
A3) Yes
A3a) Not shure
A3b) No
A3c) Not shure

Anyway, all this questions are not btget related.

Goos night remembered me to a unique man on this planet. So take a look at http://goosee.com/ and explore.

tsounny
30-03-2006, 06:06
Normally you would have only one active torrent. Second will start after first will finish.
If you want to process two simultaneously use Push command. Eg.
torent_admin -l
torrent_admin -p torrent-number
if you are using command line. For CGI interface just select torrent with radio button and press Push.

Hi Oleg
I have been watching this for long time. I gonna give it a try tonight.
One thing would like to ask, is the CGI interface come with the firmware or the torrent package? I am using 1.9.2.7-7c. by Oleg.
Thx

oleo
30-03-2006, 10:11
Just an example of processor performance meassured with nload when starting btget with 50 peers. Sample every 10 seconds.

Device br0 [192.168.1.20] (1/1):
================================================== ================================================== =================================
Incoming:
| . .## . # #
# . | # | # # | | . ### # # || | #
# # #| # # # #|#.#|# ### ..#. |# ## # . #
. ## # ###|#|# ||##.####### # ### #######|## ####.#
. # .## # #######.############ .# | ###|########## ######
# ## ### #|#################### .##.#|##############.######
# ##| ###.####################### ###########################
#.. ### ########################### # ###########################
####|###.########################### #.###########################
|#################################### #############################
#####################################|############ #################
################################################## #################
################################################## #################
################################################## ################# Curr: 1062.70 kBit/s
################################################## ################# Avg: 277.41 kBit/s
################################################## ################# Min: 8.16 kBit/s
################################################## ################# Max: 1245.57 kBit/s
. .# |################################################# ################## Ttl: 744.73 MByte
Outgoing:

. . |
#|| #.#|.|.|.# # #|#
##############|# ###
################# ###
#################.###
#####################
##################### .
##################### # .
##################### # |#
##################### # ##
###################### # . ##
###################### # #### .
####################### . #.. | #### # #
#######################|| |# ###|#|# ..#. . ... | ..#####.# | |.##| . | . Curr: 91.62 kBit/s
####################################..######..#### |# |.#########|#|#######||.# .###..|.# Avg: 260.20 kBit/s
################################################## ############################|######### Min: 60.25 kBit/s
################################################## ###################################### Max: 364.70 kBit/s
################################################## ###################################### Ttl: 2313.99 MByte


Before download start, upload was active. After download started, upload was balanced due to high processor load (11:08:48 up 17:52, load average: 3.79, 3.88, 3.15), mainly on USB subsystem.

Paullo
09-08-2006, 18:47
To open torrent ports you should add

iptables -I INPUT -i eth1 -p tcp --syn --dport 56881:56889 -j ACCEPT

to you post-firewall script inseard of wrong

iptables -A INPUT -i eth1 -p tcp --syn --dport 56881:56889 -j ACCEPT

Hellish
09-08-2006, 18:57
Thanx Paullo for your reply.
I understand that I should put the line:
"iptables -I INPUT -i eth1 -p tcp --syn --dport 56881:56889 -j ACCEPT"
instead of:
"iptables -A INPUT -i eth1 -p tcp --syn --dport 56881:56889 -j ACCEPT"
Could you be so kind and explain the difference to me between the -A and the -I switch.

-A would add a rule into the IPtables what does the -I do?

thanx

Paullo
09-08-2006, 20:20
Actualy I don't know. I looked trough a lot of topicks at this forum trying to open the ports. I tryed to use -I insead of -A and discovered that my ports were opend.

Hellish
09-08-2006, 20:25
Thanx, I will try it. Though my ports are open, I mean some BT traffic goes through, but some is filtered by the firewall and I don't understand Why. But thanx anyway.
See ya

jimmy_cr
10-08-2006, 06:41
To open torrent ports you should add

iptables -I INPUT -i eth1 -p tcp --syn --dport 56881:56889 -j ACCEPT

to you post-firewall script inseard of wrong

iptables -A INPUT -i eth1 -p tcp --syn --dport 56881:56889 -j ACCEPT

-A means Append - this add your rule to END

-I means Insert - this add your rule to BEGINNING (so it's not affected by rules added before)

is it clear now? ;)

Maximus43
26-08-2006, 08:03
Sorry for stupid questions.

1. How to start seeding if I have original .torrent file and fully downloaded target file? If I use ctorrent directly - it seems ok, but I want to use torrent_admin or web interface.

2. What means Unable to load .torrent: [2] No such file or directory in /opt/share/torrent/work/<torrent name>/current_error.log?

oleo
27-08-2006, 22:15
Sorry for stupid questions.

1. How to start seeding if I have original .torrent file and fully downloaded target file? If I use ctorrent directly - it seems ok, but I want to use torrent_admin or web interface.

2. What means Unable to load .torrent: [2] No such file or directory in /opt/share/torrent/work/<torrent name>/current_error.log?

A1. Use push command. This will rename file.torrent to torrent.seeding and start seeding withowu block check.

A2. There is something wrong with opt/share/torrent/work/<torrent name>/<torrent name>.torrent file.

Maximus43
05-09-2006, 14:29
Thank you very much for answers!
I have more questions about BT:

1. Is it usefull to install enhanced-ctorrent instead of ctorrent?
2. I tryed to install ctcs but failed with error message about perl. I have microperl installed on my router. What's wrong?
3. How I can manage memory for best BT result? It seems router respawning torrents after one-two days of activity. After that download speed become near 0 kb/s and I need to reboot router. I launch 3 torrents at once. Also Wi-Fi module stops working in this case. What should I do to avoid such memory lack?

Thanks in advance!

oleo
06-09-2006, 08:24
transmission is a nice client with a "minor" bugs.