This topic has been autolocked for inactivity. If you have something to add, Click Here to request it is re-opened.
 
#257736 by JEFFSR (The Ferret) at 2005-06-21 06:23:58 (8 years ago) - [Report]
thanks goes to XAVeRY for posting this.
This art may be still useful to some people here, so I decided to repost it.
BitTorrent uses ports in range 6881-6999 by default to communicate with the other users. However, most of today's clients use only single port, and all of the torrent downloads use only this one. The most common ones are 6881 and 6900.
But let's get straight to my mission. If you're in a LAN with Internet access, you've got a yellow light in your client, or you're unconnectable, or unsatisfied with your download speeds...read.
The drawings that I represent here show only example IP addresses, so they might or might not be the same as these in your Local Area Network (LAN).
(sorry about the drawings, I had D from art, LOL!)
OK, this image represents an typical situation of an Internet connected LAN. The only computer that has a direct connection to the Internet is the ROUTER, in fact. The rest have to pass their connections through it. There's a phenomenon of NAT going on here. We've got only one IP address (granted us by the ISP) and four computers to use the Internet. So only the ROUTER will have ISP's IP address. What does it give to the other computers?
Let's imagine that the computer with number 3 wants to use BitTorrent on port 6900. The situation will represent like this : (the arrows show the direction of the connection)
The computer can connect to other users easily. That's not a problem. But it would be too beautiful if there was no problem at all - the computer can connect only to "connectable" users. See what happens if someone wants to estabilish a connection with the computer.
The router rejects the connection, because it has no idea what to do with it. The solution is port forwarding. It tells the router what it should do with connections on certain ports. For example, if we wanted to forward the port 6900 onto computer 3, it will become connectable and will be able to connect to unconnectable users, because the router will pass all the connections on port 6900 to 192.168.1.4 IP address.
OK, and now the worse part - how to do the port forwarding?
I'll describe three possibilites.
Please remember that you CANNOT do these operations on your computer BEHIND the router! These actions HAVE TO be performed on the ROUTER with DIRECT INTERNET CONNECTION.
1. Router computer with Windows.
The easiest solution is to download and run the program AnalogX PortMapper. It's available throughout the Internet, just type the title into google. After installing the program, put it into the autostart, because it isn't able of starting "itself". The program is identified by an icon in the task bar. To configure it, just click the icon with right mouse button and select "Configure" and in the new window "Configure Mapping". A list will come up, possibly empty. Let's click "Add" and type (in another new window) some content into some fields - we have to enter our torrent port in "Enter Port" field, our IP address in the "Enter Address" field, "TCP" as "Protocol", and "Any interface" as "Interface". Click OK, and "Done" in next two windows. Restart the computer.
Just FYI, routers with Windows OS are fairly uncommon, so don't think you'll be able to only do such an easy job.
2. Router computer with Linux.
The port forwarding is possible only in Linux kernel series 2.4.x and higher.
Let's check for the vital component of doing port forwarding - iptables. Type "iptables -v" in your console and see if it gives out any result. If it does, you're ready to forward some ports. If it does not, then you have to install iptables from your Linux distro CD or download IPtables from www.netfilter.org OK, edit the /etc/rc.d/rc.local file and type in those lines : (modify them of course!)
iptables -t nat -A PREROUTING -p tcp -i eth0 -d (A) --dport (B) -j DNAT --to (C)D)
iptables -A FORWARD -p tcp -i eth0 -d (C) --dport (D) -j ACCEPT
The key is :
(A) - router's IP address, mostly 192.168.1.1
(B) - port, where the service will run on
(C) - our IP address
(D) - exactly the same as (B)
For example, if my router has IP address 192.168.34.56, and I wanted to forward the port 49156 onto 192.168.34.216, the syntax will look like this :
iptables -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.34.56 --dport 49156 -j DNAT --to 192.168.34.216:49156
iptables -A FORWARD -p tcp -i eth0 -d 192.168.34.216 --dport 49156 -j ACCEPT
Understood?
3. Hardware router.
I have no experience in hardware routers, the only thing you can do is to refer to www.portforward.com/routers.htm
Please remember to activate the option "Allow Multiple Connections from the same IP" (in Azureus) or to deactivate the option "Don't Allow Multiple Connections from the same IP" (in BitTornado). If you do forget, then the port forwarding won't do the wanted effect.
Hope I lit up your minds a little.
-XAVeRY
Please PM me if you have any questions, ideas or propositions to add to this art.
#261365 by unknown[3535] at 2005-06-23 03:29:03 (8 years ago) - [Report]
I have also managed to get connectable behind an ISA server which adds an extra layer of complexity to the process. Feel free to PM me if you need any help.
 
This topic has been autolocked for inactivity. If you have something to add, Click Here to request it is re-opened.