Tunnel incoming rtorrent connections to rtorrent

bittorrentPROXYrtorrent

I'm running rtorrent on a seedbox, but this seedbox has significant bandwidth restrictions. I have another server (I'll call it the proxy) with no bandwidth restrictions which I'd like to use as a proxy when leechers are connecting to my box (the connection between the seedbox and the proxy has no bandwidth restrictions).

There are a few ways I could see this working out, but I'm not sure on the details (mainly I'm unsure of how to coax rtorrent into doing what I want):

  • ssh from the seedbox into the proxy, reverse forwarding the incoming connections port to localhost. The problem is: how do I get rtorrent to tell peers that they should connect to the proxy and not to the seedbox directly?

  • ssh from the seedbox into the proxy, set up a SOCKS tunnel, and wrap all rtorrent traffic in the tunnel. This is feasible, but I'd like to avoid the hackiness of force-tunneling rtorrent connections without rtorrent knowing what's going on (per this answer, I'd likely have to do it without rtorrent's knowledge).

Any ideas?

Best Answer

Since you have root access to the proxy box I guess I would recommend redirecting 1 or more ports directly to the seedbox. I would then pin rtorrent so that it was either running on 1 or more of these identical ports. Looking at the ArchLinux Wiki page on RTorrent it seems you'd be able to configure rtorrent so that it only used 1 or a few of these same ports.

port_range = 49164-49164

You'll also likely want to open the DHT port:

dht = auto
dht_port = 6881
peer_exchange = yes

But of the options presented, this seems the cleanest to me and would require the least amount of effort to configure/setup.

Related Question