Support libtorrent option allow_multiple_connections_per_ip #4830

Closed
opened 2026-02-21 17:31:42 -05:00 by deekerman · 2 comments
Owner

Originally created by @romanrm on GitHub (Oct 31, 2016).

Hello,

As also posted by someone earlier in https://bugs.launchpad.net/qbittorrent/+bug/894545

I would like to propose supporting libtorrent option "allow_multiple_connections_per_ip" in Advanced settings (off by default).

My reason: due to a specific forwarding+load balancing setup, I see all incoming connections to the torrent client as coming from the same set of 2 or 3 IPs. To be able to accept multiple connections per each IP, I need allow_multiple_connections_per_ip enabled. I have recompiled qBittorrent with that, but the peer list is still shows IPs only once. However this actually works fine, as my total upload speed for each torrent is now way higher, and doesn't match than the sum of upload speeds to peers that I see in the list. (So just a cosmetic issue of making the peer list not group by IP).

Secondly, there are now ISPs which place their customers behind a Carrier-Grade NAT (CGN), where many customers will share the same Internet IP, and will be unfairly limited to just one connection per that IP by other users' torrent clients.

This option opens some abuse potential via multiple client impersonation by remote peers, but personally I am not worried as I'm fine with seeding as fast as people can possibly fetch, and normally have my uplink underutilized anyways. And in any case it won't hurt anyone if it's off by default.

Originally created by @romanrm on GitHub (Oct 31, 2016). Hello, As also posted by someone earlier in https://bugs.launchpad.net/qbittorrent/+bug/894545 I would like to propose supporting libtorrent option "allow_multiple_connections_per_ip" in Advanced settings (off by default). My reason: due to a specific forwarding+load balancing setup, I see all incoming connections to the torrent client as coming from the same set of 2 or 3 IPs. To be able to accept multiple connections per each IP, I need allow_multiple_connections_per_ip enabled. I have recompiled qBittorrent with that, but the peer list is still shows IPs only once. However this actually works fine, as my total upload speed for each torrent is now way higher, and doesn't match than the sum of upload speeds to peers that I see in the list. (So just a cosmetic issue of making the peer list not group by IP). Secondly, there are now ISPs which place their customers behind a Carrier-Grade NAT (CGN), where many customers will share the same Internet IP, and will be unfairly limited to just one connection per that IP by other users' torrent clients. This option opens some abuse potential via multiple client impersonation by remote peers, but personally I am not worried as I'm fine with seeding as fast as people can possibly fetch, and normally have my uplink underutilized anyways. And in any case it won't hurt anyone if it's off by default.
Author
Owner

@thalieht commented on GitHub (Jun 12, 2017):

Linking to PR this might fit in... if accepted: #3235

@thalieht commented on GitHub (Jun 12, 2017): Linking to PR this might fit in... if accepted: #3235
Author
Owner

@Seeker2 commented on GitHub (Jun 12, 2017):

Even without this option, you can have the same ip connected multiple times, limited to 1 per torrent.

If this option is added, it needs to be with the stipulation that duplicate ips on the same torrent must be different in some other minor way, like different session/peer id (or if something like that can't be used -- different listening port or BitTorrent client) to mitigate the effects of hostile BitTorrent attacks already seen in the wild.

Another PR this might fit in: https://github.com/qbittorrent/qBittorrent/issues/6421 "I plan to create a PR for missing and hardcoded session settings"

@Seeker2 commented on GitHub (Jun 12, 2017): Even without this option, you can have the same ip connected multiple times, limited to 1 per torrent. If this option is added, it needs to be with the stipulation that duplicate ips on the same torrent must be different in some other minor way, like different session/peer id (or if something like that can't be used -- different listening port or BitTorrent client) to mitigate the effects of hostile BitTorrent attacks already seen in the wild. Another PR this might fit in: https://github.com/qbittorrent/qBittorrent/issues/6421 "I plan to create a PR for missing and hardcoded session settings"
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#4830
No description provided.