Multi-homing support

Suggestions and discussion of future versions
Post Reply
str77
New User
New User
Posts: 9
Joined: Mon Aug 17, 2020 7:16 pm

Multi-homing support

Post by str77 »

Hello,

I run deluge on a linux "big storage" box with several ipv4 addresses.
Deluge listen interface is set to one of the box local ipv4, e.g. 10.3.14.15
My internet router has VPN connections, and I route the deluge box through the VPN via ipv4 10.3.14.15.
This works fine, all deluge traffic goes through the VPN. The occasional DNS queries initiated by deluge when resolving tracker address too, with additional work with dnsmasq and netfilter...

Now I'm thinking of having a VPN provider that supports ipv6.
It's not currently possible to configure several listen interface in the deluge web UI and in the core.conf file.
I cannot run as root, so interface name is not an option.

Are there plans to support multiple listen interfaces?
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Multi-homing support

Post by mhertz »

Probably, but development/manpower is slow as you might know. Last changes to that code, had some comments about first prioritizing getting single interface/ip to work firstly, so that must mean is in the planning I presume.

In mean-time however, I believe you can use ltconfig plugin, to set libtorrent listen_interfaces/outgoing_interfaces, and just remember listen_interfaces needs a port appended. You can use interface name too, instead of dual IPs, though so_bindtodevice isn't called as not root, but libtorrent should still resolve IPs of said interface and use, i'm pretty sure, according to Arvid.
str77
New User
New User
Posts: 9
Joined: Mon Aug 17, 2020 7:16 pm

Re: Multi-homing support

Post by str77 »

Thanks, I will test along your suggestions regarding the interface names.
For the moment I'm stuck with version 1.3.14, for which this don't work.
When I manage to get 2.0.x to run correctly, I will test it.

Regarding LT config I think that the listen_interfaces libtorrent parameter is not managed:
https://github.com/ratanakvlun/deluge-l ... presets.py

I guess this is because it would conflict with the regular deluge Network interface parameter of the Network tab.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Multi-homing support

Post by mhertz »

I have only tested this on deluge2, recently, and there I could set both listen and outgoing interfaces from ltconfig. I was little unsure if would work, since I too thought it would interfere with deluge, but ltconfig settings are just "smacked on last" I believe, overriding deluge settings, and the debug-log stated no issues and stated I was listening to whatever I had defined under there. Again, you have to control directly with listening port and override deluge's logic completely. Ltconfig also lists its current value for each setting and there I could check it was defined properly too.
str77
New User
New User
Posts: 9
Joined: Mon Aug 17, 2020 7:16 pm

Re: Multi-homing support

Post by str77 »

I contributed a PR with a change doing this with the regular deluge network options:
https://github.com/deluge-torrent/deluge/pull/300

I don't think there's a ticket for that yet, so if you can provide it will be much appreciated.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Multi-homing support

Post by mhertz »

Thanks for your contribution, appreciated! :) I made two tickets related to this, and also mentioned that, not that long ago, here:

https://dev.deluge-torrent.org/ticket/3415
https://dev.deluge-torrent.org/ticket/3417

One for connection binding in general and one for IPv6 support broken by default in deluge in latest libtorrent's.

I posted new comment about your PR in both.

As you probably know, things are a little slow for the last bit of time, e.g I currently have 11 still not-closed deluge tickets, but people atleast can just build from your PR branch themselves in mean-time.

BTW, in deluge2 there's also an outgoing connections field, and deluged cli option. Windows users needs curlybrazes allowed for a full implementation.

Thanks again.
str77
New User
New User
Posts: 9
Joined: Mon Aug 17, 2020 7:16 pm

Re: Multi-homing support

Post by str77 »

Thank you.
I will test a bit more with the outgoing interface stuff.
In principle I know how it works, because stuff like squid, dnsmasq, and the like need this to properly multi-home in some situations.
However from the lib torrent documentation, Arvid writes that it's only used for outgoing TCP connections (from the deluge server perspective).
This doesn't make complete sense for me, because this is also needed for uTP (UDP) in principle. E.g. when the deluge daemon sends the initial uTP message to a new peer, this needs to be sent via the desired interface.
There's also another parameter related to routing, which may achieve the same thing, so I'll definitely look into that.
str77
New User
New User
Posts: 9
Joined: Mon Aug 17, 2020 7:16 pm

Re: Multi-homing support

Post by str77 »

I just re-read the docs https://www.libtorrent.org/reference-Settings.html
All is fine:
- listen_interfaces is used for both in/out uTP and tracker, and for incoming TCP
- outgoing_interfaces is used only for outgoing TCP

Both parameters need to be consistent to muti-home properly.
Post Reply