qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.1k stars 3.96k forks source link

bind several addresses of different interfaces #19285

Open billkewl opened 1 year ago

billkewl commented 1 year ago

Suggestion

qBittorrent & operating system versions

qBittorrent-nox v4.5.4 Linux Debian 12

Qt: | 6.5.1 Libtorrent: | 1.2.19.0 Boost: | 1.82.0 OpenSSL: | 3.1.1 zlib: | 1.2.13.zlib-ng

Use case

My self hosting server has several network interfaces. Due to security reason, I don't want to expose some addresses to trackers but at the same time I need to bind to two IPv4 addresses from interface A and one IPv6 address from interface B. Currently, qBittorrent can either bind to one address, all addresses or a whole address family (IPv4/IPv6) from one single interface or all interfaces but there's no granular setting.

Since there's no such settings on webUI, I tried to change bind setting of conf file but it didn't work.

Now that qBittorrent can bind to multiple addresses, I suppose it's not impossible to bind to specific addresses instead of unspecified address? Also I found this on libtorrent docs

name type default
listen_interfaces string 0.0.0.0:6881,[::]:6881

a comma-separated list of (IP or device name, port) pairs. These are the listen ports that will be opened for accepting incoming uTP and TCP peer connections. These are also used for outgoing uTP and UDP tracker connections and DHT nodes.

It is possible to listen on multiple interfaces and multiple ports. Binding to port 0 will make the operating system pick the port.

Extra info/examples/attachments

No response

DanielZhang17 commented 8 months ago

It's great if this feature can be added to the webUI. I want to have qbittorrent bind to the ipv4 address of one interface and the ipv6 address of the other interface. Currently it appears that the only way to work around the limitations of qbittorrent is to create a virtual interface that binds to the addresses needed and then have qbittorrent bind to that interface, but this is kinda tricky to do.