Click to See Complete Forum and Search --> : configuring linux/ router for bittorent
joegain
05-22-2007, 04:12 PM
hello everyone,
I am new to linux and have just installed the torrent client aria2c. Unfortunately it is very slow. When I was using windows, I used to be able to fix this problem by giving my computer a static IP-Address and then making available a number of ports for the torrent client.
How can I do this in Linux? I can give myself a static IP by using ifconfig, and by editing the /etc/sysconfig/network-scripts/ifcfg-eth0 (but I'm ot sure about all the options for this scipt)- but what about the ports?
Using aria2c, I can make the client liste to a single port with the --listen-port=xxx, but is it possible to use a range? Do I need to do that?
Thanks,
Joe
cybertron
05-22-2007, 06:12 PM
Where did you open ports in Windows? On a wireless router? A firewall on the PC? You should be able to do the same thing in Linux either through the router's web interface or using your distro's firewall configuration utility.
As far as one port vs. multiple ports, I'm not sure off the top of my head, but I think most torrent clients can use a range of ports, although I'm not familiar with aria2c.
joegain
05-22-2007, 06:38 PM
Thanks for the reply.
Using Windows I used to open up the ports through the router's fiewall web interface (Belkin F5D7231-4.)
I've just tried to set up a static IP for the computer by modifying /etc/sysconfig/network-scripts/ifcfg-eth0 to
DEVICE=eth0
IPADDR=192.168.2.100
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
NETWORK=192.168.1.0
which worked fine, in that...
[joe@localhost Desktop]$ su -c '/sbin/ifconfig -a'
Password:
eth0 Link encap:Ethernet HWaddr 00:0E:A6:1B:8A:99
inet addr:192.168.2.100 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::20e:a6ff:fe1b:8a99/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:103690 errors:0 dropped:0 overruns:0 frame:0
TX packets:85840 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:102367823 (97.6 MiB) TX bytes:7260623 (6.9 MiB)
Interrupt:177 Base address:0xe000
But I lost my connection. (And wasn't able to ping anything etc.)
So, I don't understand what happenned- is the router setting my (local) IP address? I mean am I being allocated an IP number by dhcp which I have to use? Or in other words, how does the router know my IP number?
JRefL5
05-23-2007, 12:07 AM
joe, set your router ot issue the statis address to the computer.
Note that 192.168.2.100, is not in the same network as the router 192.168.1.0 from your mask settings (255.255.255.0).
deathadder
05-23-2007, 02:00 AM
It's been a while since I've actually done any subnetting, but 255.255.255.0 is the standard subnet mask for a class c network. So any address within the range 192.0.0.0 to 224.0.0.0 is valid for that subnet mask.
So saying that the network is 192.168.1.0 because of the subnet mask is incorrect, joegain's ip address is perfectly valid for the network mask.
joegain:
Could you no longer ping anything using the domain name? If so, put your routers IP address into /etc/resolve.conf, this tell your machine where to check for for a DNS server, the router will have settings stored in it form your ISP.
When your using DHCP, all required information is set during the IP requests to the router, so you machine knows where it can resolve DNS requests. When your using static IP addressing the router doesn't know what your IP address is. To find your machine it has to issue requests to find you, basically a request is sent over the network and the router waits for a machine to acknowledge it's request.
joegain
05-23-2007, 02:02 AM
Thanks JRefL5 for the heads up about the error with the networkaddr.
But, I'm still not quite clear about what to do now.
At the moment the router is allocating IPs to the people on the network- I actually have the IP 192.168.2.8. There are a number of other computers/people also attached to the router using dhcp. If I set my IP to be static, do you think it should be possible that I can demand the IP that I set from the router? Or do I have to change the dhcp on the router?
(I think I have to study the router user manual.)
Thanks deathadder: I just read your reply! I'll try that later tonight (have to go to work now). And I was able to ping the router.
deathadder
05-23-2007, 02:12 AM
Well, trying to demand a specific IP address from a DHCP server, defeats the object of DHCP. It sounds like your worried that the router will issue your IP address to someone else, so causing a conflict, what you can do is setup your router to only issue IP addresses in a range, I know mine at home only issues addresses in the range 192.168.2.2 - 192.168.2.100, the other addresses 192.168.2.101 - 192.168.2.254 are left for static addresses. You should probably see if your router has something like that setup and give yourself a address outside of the range. However if it doesn't, I would either setup a range of addresses to be handed out using DHCP or request this from the routers admin.
joegain; since you were able to ping the router, I'd bet that adding your routers IP address to /etc/resolve.conf will sort our your issue.
cybertron
05-24-2007, 02:19 PM
Most routers that I've seen also have a way to permanently assign an IP to a MAC address, so it would always issue the same address to your PC. You might still need to set the range of the DHCP server so that it didn't include that address, but I prefer to let the router handle IP's rather than assigning static IP's locally, so I like to use it anyway.
Also, regarding the subnet mask, that's not necessarily related to the class of network you're on. For a 192.168.x.x address you should probably use a mask of 255.255.0.0, because that particular private address range only requires that the first two numbers be the same. You can add the third 255, but then the first three will have to be the same and 192.168.2.x won't be able to talk to 192.168.1.x addresses. Subnetting can get a bit complicated (especially if you start splitting octets and using masks like 255.248.0.0;)) but basically I think if you change yours to 255.255.0.0 you will at least be able to ping again.
justlinux.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.