qBittorrent running over THREE Mullvad connections!
I’ve built a tool some people might be interested in called qBitMF (qBittorrent-MultiFace): https://github.com/qBitMF/qBitMF
It’s a modified version of qBittorrent that balances torrent connections over multiple VPN servers, which means if you have a fast internet connection, this stops you from being limited by the speed of one (potentially overloaded) VPN server. And because qBitMF uses qBittorrent and WireGuard, both of which are very efficient, you should be able to max out even the fastest internet connections with this!
-–
(overly nerdy stuff follows)
This started out as an experiment to see if it was possible to get any torrent client to run over multiple VPN connections at once. After much research and exploration, I discovered two features in Linux that enabled this: network namespaces, and multipath routing.
Network namespaces completely isolate qBittorrent from the internet, and thus no kill switch is required: it has no access to any “real” interfaces, including DNS or even the ability to figure out a local IP address. It only has access to WireGuard network interfaces and that’s it.
Multipath routing balances outgoing connections between multiple interfaces, and chooses the interface based on the IPs and ports of a given connection via hashing, which both balances usage of interfaces, but also makes sure the packets of any specific connection always goes through the same interface.
Incoming connections was another issue to overcome. Since a listening port only exists on one interface, the multipath routing would often try to respond on a different interface, which would break connections. I found that by using a specific network setting in libtorrent (SO_BINDTODEVICE), I could make incoming connections ignore the hashing that multipath routing uses. That way, if an incoming connection comes in on one interface, it stays on that interface.
Finally, I put it all in docker because that’s the easiest way to distribute a fully-functioning system. Of course, due to all the OS-specific functionality being used, this will only work on Linux. I wouldn’t even know where to begin building something like this for Windows.
-–
Anyways, hope people find this tool to be useful!