Deluge ignores default network interface and uses all interfaces

General support for problems installing or using Deluge
Post Reply
brocellous
New User
New User
Posts: 3
Joined: Sun Jul 23, 2023 7:42 pm

Deluge ignores default network interface and uses all interfaces

Post by brocellous »

The tooltip for "incoming interface" in the preferences menu reads:

> IP address or network interface name to listen for incoming BitTorrent connections. Leave empty to use system default.

In my interpretation the default interface is one which has a default route, but in practice I observe that deluge listens on all available interfaces — apparently one socket bound to each iface. In typical use case, I have a vpn established by wg-quick, which gives a routing policy and default route to send all traffic to the vpn interface, and in general I find that works for every application _except_ for deluge. If it matters, I use the archlinux iso magnet to test, available at https://archlinux.org/download, and I just watch for outgoing traffic to anywhere other than the vpn endpoint in tcpdump and see bt-dht packets on every interface while deluge is open, while everything else (that does not otherwise bind a specific interface, e.g. ping -I) uses only the vpn interface.

Perhaps the tooltip should read "leave empty to use all interfaces"? The "external IP" description in the status bar is also confusing, since apparently deluge is really listening (and receiving) traffic on several interfaces+ips, but it apparently reports only one of the addrs. Is my understanding of deluge's behavior incorrect here? If not, can we update the status bar to show all (external) listen ips? For the record, deluge -L info _does_ report all (3 in my case) external ips correctly in "on_alert_external_ip" messages in my case.
User avatar
ambipro
Moderator
Moderator
Posts: 445
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Deluge ignores default network interface and uses all interfaces

Post by ambipro »

I think maybe you should check out something like https://github.com/binhex/arch-delugevpn

Aware that this doesn't solve the systemic messaging issues in the program, but since your issue also seems to be with the behavior, this might help with that at least.
brocellous
New User
New User
Posts: 3
Joined: Sun Jul 23, 2023 7:42 pm

Re: Deluge ignores default network interface and uses all interfaces

Post by brocellous »

I don't mind assigning the network interface explicitly in the preferences, which is satisfactory for my use case. I just didn't expect I would have to. It's the default behavior that is surprising.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge ignores default network interface and uses all interfaces

Post by mhertz »

You're right and indeed a better tooltip would make sense here. Btw, all you mention is libtorrent related, not deluge. Deluge needs currently minimum libtorrent 1.2.x, and all this changed in 1.2.4 and is because of multi-homing additions, making a listen socket to all interfaces accepting incoming connections. Anyway, deluge hooks on libtorrent's external_ip_alert event, and passes it on to it's statusbar component, just using markup to lower it's font-size, or adding 'n/a' if nothing recieved from libtorrent currently. In libtorrent's api docs, it states returning the alert whenever learning about it(which is from trackers supporting acquiring that, or peers supporting the extension protocol), so presumably the IP could change repeatedly, based on that.

Also, deluge currently by default only supports ipv4 unless adding the incoming binding setting appropriately, in contrary to deluge1. It's because libtorrent 1.2.x changed to understand '0.0.0.0' as deluge defines by default when unset, as default route ipv4, and later(1.2.4+) all ipv4 accepting incoming, whereas in libtorrent 1.1.x and down was default route anywhere. If wanting ipv6 also, and not binding any specific interface, then need define yourself: '0.0.0.0, [::]' which also is default btw in libtorrent, but just overridden by deluge. The devs haven't gotten to that yet, I made a ticket about it before a few years ago im pretty sure, though PR would be better of-course, and fix text likewise.

Anyway, good observation and tip, thanks.
brocellous
New User
New User
Posts: 3
Joined: Sun Jul 23, 2023 7:42 pm

Re: Deluge ignores default network interface and uses all interfaces

Post by brocellous »

Thanks for the response. I'm not sure what the best UI to show all external IPs in the status bar would be, but I reckon just updating the tooltip and and the status bar to indicate what's really happening should be enough.
Menard
Leecher
Leecher
Posts: 75
Joined: Mon Feb 07, 2022 11:31 am

Re: Deluge ignores default network interface and uses all interfaces

Post by Menard »

Did you check if you appear in the Ips tracked by the iknowwhatyoudownload website ?
I ve found a solution for this site if you want it, for Linux especially, quite simple finally with ufw, no torrent leaks with the VPN with this (it is Deluge 2.0.3)
Post Reply