Bind Deluge to specific interface in 1.3.15 using lt_config

Specific support for Deluge on Microsoft Windows OS
Post Reply
showstoppre
New User
New User
Posts: 7
Joined: Mon Apr 26, 2021 6:25 am

Bind Deluge to specific interface in 1.3.15 using lt_config

Post by showstoppre »

I'm trying to bind my VPN NIC to Deluge.

It looks like it can be done using 'listen_interfaces' through lt_config plugin.

Currently I can bind an IP address this way. I wanna bind the entire interface as IP would be changing. I'm not sure what is the equivalent of "eth0" in Windows.

Any help would be appreciated. Thanks in advance
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Bind Deluge to specific interface in 1.3.15 using lt_config

Post by mhertz »

Yes, as you said you need ltconfig plugin as the binding option(s)(in plural only in deluge2) in deluge doesn't support this(but strangelovian made PR for deluge2 implementing this, which works good btw).

Yes it's listen_interfaces and outgoing_interfaces, set the interface as the later and append a colon plus port(no spaces) as former, and check after restart that it works by looking at the ltconfig column showing current value and when I tested this I checked debug logging also to look what happened - I remember making it work I believe(checked it just a single time to see if would work, so not remember 100% honestly), but though was with deluge2(before strangelovian submitted his PR fixing this. Select same incoming port in deluge as you hardcode yourself, or atleast believe I did.

Very important(also with strangelovian's PR) is to follow the libtorrent API docs, meaning the two interface binding options should on windows when using interface-names specifically be GUID, upper-cased and in curly braces, plus appended colon and port for the listen_interfaces. You get the GUID by running from elevated cmd 'net start dot3svc & netsh lan show interfaces & net stop dot3svc', and then as said uppercase that, and if not already then curlybraze it(think is already, but just in case) and colon+port added to it for the listen_interfaces option.

Also, if getting issues doing this, then possibly you could directly hardcode it into the deluge code instead - I've not tried on deluge1, but in deluge2 did change the default binding option atleast for listen_interfaces(to make IPv6 work again when using libtorrent 1.2.x which didn't by default, only with libtorrent 1.1.x), so guessing could be done, but never tred with GUIDs or on deluge1 however, as said.

Personally, with or without this option, I would check if the local IP of VPN is always from same Subnet e.g just the last or last + second last number in IP changing etc, and then setup a few windows firewall rules restrcting in/out traffic only through that subnet for deluge and nothing else, making a good kill-switch and not only rely on deluge/libtorrent for this where possibly errors could occur at some later point(not very big chance I'd guess, but nonetheless). Instead Subnet then could also restrict from never using private network(if vpn is public like default), but prefer the Subnet filtering myself, which I setup for a family member running windows(though qbittorrent there, as they preferred that, but irrelevant).
showstoppre
New User
New User
Posts: 7
Joined: Mon Apr 26, 2021 6:25 am

Re: Bind Deluge to specific interface in 1.3.15 using lt_config

Post by showstoppre »

mhertz wrote: Thu Jul 01, 2021 10:12 am
Very important(also with strangelovian's PR) is to follow the libtorrent API docs, meaning the two interface binding options should on windows when using interface-names specifically be GUID, upper-cased and in curly braces, plus appended colon and port for the listen_interfaces. You get the GUID by running from elevated cmd 'net start dot3svc & netsh lan show interfaces & net stop dot3svc', and then as said uppercase that, and if not already then curlybraze it(think is already, but just in case) and colon+port added to it for the listen_interfaces option.
Thanks. This is what I was looking for. I wonder how I missed this in libtorrent docs. Guess I didn't scroll enough. I'm confident listen_interfaces works when binding IP address. I'd have to check if it works likewise when binding interface.

But again as you said, it is definitely worth using Windows FW to restrict deluge to the subnet VPN IP is in.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Bind Deluge to specific interface in 1.3.15 using lt_config

Post by mhertz »

Listen_interfaces is most important yes, i.e it's this which is used for announcing that IP(or IP of device) to tracker/swarm, but might as well also bind the other libtorrent option outgoing_interfaces imho when available. Atleast on deluge2 it worked same, if using IP or device, and is libtorrent, not deluge doing the leg-work, so should work on older libtorrent too(deluge1), I'd guess atleast. Hope works good for you, and you're welcome :)
Post Reply