There is an active, and passive mode when we talk about torrent. Passive, is when you can't connect to the peers actively. Active is when your ports are forwarder, and others can connect to you.

What I did so far, is installed a Debian on my server. Then I added GatewayPorts yes into my sshd_config file. After that, in PuTTY, I set up the following configuration:
- Remote ports do the same
- Local ports accept connections from other hosts
Then I added a new forward like:
4D8080 (IPv4, Dynamic, at my PC's port 8080).

After this, I set my uTorrent to use SOCKS5 proxy for every possible connection, at localhost, port 8080. But, my client will show the red sign at the bottom-right part.

Is there a solution to this? (Something is surely not right, I get 0 DHT nodes too.)

link|improve this question

Your description tells us how you connect to your debian server, so presumably your outgoing torrent connection is putty->debian->internet. You are advertising a port range in your client, how are these ports getting to the debian server? Is it on a public IP? – Paul Dec 14 '11 at 12:59
The server is on a public IP, yes. I'm using a random port (let's say 23456 in my torrent client), and a 8085 like port in my PuTTY + uTorrent's proxy page. My PC (uTorrent) -> SOCKS5 (127.0.0.1) -> PuTTY (remote IP) -> Debian server (with public IP and SSH server, and GatewayPorts yes) -> Internet. – Shiki Dec 14 '11 at 15:32
There is a howto by the MyEnTunnel's author, which sadly doesn't work. nemesis2.qx.net/forums/index.php?topic=23.0 But maybe, someone will be able to solve the mystery. – Shiki Feb 14 at 19:34
feedback

2 Answers

you need to do it the other way around ... You need to have remote ports accepting connections from other hosts. And a firewall rule on your server allowing incoming traffic to the listening port set in utorrent preferences. (although i'm not sure if this gets propagated through socks - you need to try it out and check netstat)

link|improve this answer
As far as I know, GatewayPorts do the first thing you mentioned. About the firewall... there is no firewall, no iptables. It's disabled. – Shiki Dec 14 '11 at 12:29
(Uhm.. and if someone knows what I'm missing, please elaborate. Be noob friendly, I'm new to this thing. And I guess if someone will do a Google search on the topic, will appreciate it too. :)) – Shiki Dec 14 '11 at 12:33
feedback

The dynamic SOCKS proxy mode (the "D" option) cannot handle incoming connections for you because there's no such provision in the protocol. A proxy protocol is only supposed to handle your outgoing connections after all.

You need to add a remote redirection (the "R" option), so your SSH server listens on a port and redirects the packets to you. See the following man page extract:

 -R [bind_address:]port:host:hostport
     Specifies that the given port on the remote (server) host is to
     be forwarded to the given host and port on the local side.  This
     works by allocating a socket to listen to port on the remote
     side, and whenever a connection is made to this port, the connec-
     tion is forwarded over the secure channel, and a connection is
     made to host port hostport from the local machine.

     Port forwardings can also be specified in the configuration file.
     Privileged ports can be forwarded only when logging in as root on
     the remote machine.  IPv6 addresses can be specified by enclosing
     the address in square braces or using an alternative syntax:
     [bind_address/]host/port/hostport.

     By default, the listening socket on the server will be bound to
     the loopback interface only.  This may be overriden by specifying
     a bind_address.  An empty bind_address, or the address '*', indi-
     cates that the remote socket should listen on all interfaces.
     Specifying a remote bind_address will only succeed if the
     server's GatewayPorts option is enabled (see sshd_config(5)).

Note however this port forwarding feature can change origin IP of the remote peer which can mess up the bittorrent protocol. If this is the case, you need to use VPN instead of SSH.

link|improve this answer
Where can I find this "R" option in PuTTY? Or should I use Cygwin? By the way, I tried using the remote redirection (in Tunnelier), but uTorrent didn't work at all. – Shiki Dec 14 '11 at 15:46
(The protocol stuff: BTguard.com uses SOCKS5 proxy too and it works perfectly. That's why I thought PuTTY/SSH would work.) – Shiki Dec 14 '11 at 15:47
The option is called "Remote" in the same place you find the "Dynamic" option. – billc.cn Dec 14 '11 at 15:47
SOCKS5 does support UDP which is usually used to do NAT-traversal. However, SSH may not support this. – billc.cn Dec 14 '11 at 15:52
Maybe I'm doing something wrong. I tick the "Remote" option. THEN, Source port: 8081 (port is forwarded in my router, just in case); Destination: 80.211.203.92:23456 and IPv4. But after launching the connection, set uTorrent to this address, and it can't connect at all. :/ – Shiki Dec 14 '11 at 15:54
show 5 more comments
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.