Torrent client over a tunnel? Ideas?

Hey fellas...

My default gateway is fine for everything except torrent traffic. I can't for the life of me figure out how to get transmission to work over the tunnel that I have working perfectly on the router already.

Got any ideas how I can get all those torrent protocols to go over the tunnel without disrupting the normal gateway traffic?

It's like I need to run the transmission package on a second IP, and then route that source IP over the tunnel. There doesn't seem to be a way to do it though. :disappointed_relieved:Thanks for reading and/or commenting. Appreciate the input.

VPN typically redirects the default gateway, which applies to both egress and outgoing traffic.

Thanks for the reply.

My vpn is not for anonymity but to circumvent some restrictions of the ISP. I got it set up to not be the default gateway. I have a few static routes that direct traffic over the tunnel. They are working fine. They are rudimentary however, certain destination IPs go over the tunnel.

Got any ideas?

You can invert the routing policy:

  • Route to WAN everything that doesn't match the VPN criteria.
  • Route to VPN by default.

Other options:

  • Set up the torrent client on a separate host.
  • Bind the torrent client to the VPN tunnel IP.

See also:

I would love to bind the torrent client to the vpn ip. I read your post about that.

I tried that before manually by changing the transmission config parameter. "bind ipv4 ip", but it seemed to me that it didn't work because its purpose is it tells other clients to connect to this IP for incoming connections. Isn't it?

It didn't seem to affect outgoing connections. Hmm...

Is your method any different?

Could you help me confirm that it does actually affect outgoing connections?

Cheers! You've been very generous with the help. Thanks man.

have not tried this myself but you can probably use IP Aliasing, bind transmission on the virtual IP, then create rule in vpn policy routing for that IP

Personally, I have set a TOR relay, with a TOR proxy, and use it when needed to surf or to download torrents...
Just have to set the proxy IP and Port on clients applications (browser of torrent downloader) !

The tunnel is configured on the router? Is the transmission client also running on the router? You may want to post configs for more specific replies.

Thank you all so much for the suggestions!

Yeah I got the tunnel and transmission on the router. I'm using the tunnel every day as I need it to access a certain IP from all my clients behind the router. The tunnel is not set as the default gateway. For transmission I'd like it to be the default gateway. Transmission does not have proxy opions anymore, but frankly, even if it did, it doesn't work with UDP trackers and DHT. It would be a severely crippled torrent client.

Ok, cool!

What openwrt torrent client are you using? Don't DHT and UDP trackers always fail to connect with proxy mode on?

Thanks for the reply!

Yeah, that would be great. The question is, how do you bind transmission to the other IP? Also, will it affect outgoing connections or just change the "listening" ip?

I use qbitorrent on ubuntu…
No problem to download at full speed of my ADSL connection…

@alcatraz The easiest way would be to use networking namespaces, but I don't know if OpenWrt supports that by default.

You'd make your VPN the only connection to the outside world in that namespace, and run your torrent client in it. The network would be completely separated from the default network.

No need to do any specific routing etc. But you need to set up the namespaces of course :grinning_face_with_smiling_eyes:

Edit: looks like it does:

I did a write-up here.