This behaviour has been ongoing for some time, but a forum post here on a VPN users' forum with other users presenting the same issue prompted me to post here. I have the latest 3.1.12 qBt installed on Linux Mint 17.1 x64 with Cinnamon DE. When running over OpenVPN (tun0 adapter) the same is selected in qBt as the interface to which traffic should be bound. Unfortunately when the VPN goes down and the interface disappears, qBt continues to download over any available interface and the tun0 option simply disappears from the list in advanced settings (or alternatively stays in the list but the setting is ignored).
I have found that traffic is often slower when this happens (eg an Ubuntu torrent gets 18MB/sec over tun0 when the VPN is active but 2MB/sec when tun0 goes down), but traffic is traffic and it's still leaking. Chatting with others having the same experience on the other forum prompted this thread to see if it was a known bug or whether there's a workaround. Here's a screenshot from another user (used with permission), which demonstrates the problem. Many thanks in advance.
I just realised that the reason I originally joined this forum was because the real WAN/ISP IP is leaked by qBt when a SOCKS5 proxy refuses connections (when qBt should refuse to send traffic unless over the specified proxy). That thread is here. So at present the app doesn't reliably use the SOCKS5 proxy if specified, and doesn't actually bind to tun0. That's really quite concerning! Luckily my VPN sets firewall rules upon connection that make it impossible for traffic to leak if the VPN goes down, but others aren't so lucky which is why I decided to post up and help get this resolved.
@Sledgehammer I also note in that original thread (a year ago) about the proxy not being adhered to that you replied asking me to file a bug report with libtorrent. Unfortunately I wasn't notified about your reply and thought my thread had died, but I will endeavour to replicate the issue and file a bug report with them in due course. It's true that qBt is the best torrent program out there regardless of platform, but until it's working nice with interface binding and SOCKS5 proxies it's somewhat dangerous and giving a false sense of security.
VPN:
When tun goes down, do you see new messages in view->execution log? (not immediately, say after ~5mins)?
Does the speed keep decreasing until the torrent goes to "stalled" status?
Can someone use a tool (maybe wireshark) to see if qbt actually sends traffic via other interface when tun goes down?
Proxy:
Hmm this is a hard one to explain, because libtorrent has change things on how it handles this even in the 0.16.x series.
Can you tray enabling anonymous mode? (tools->options->bittorrent->privacy)
Do you have access to windows? If yes, use my last alpha. Check "disable connections not supported by proxies" in the proxy options.
This one was added in libtorrent 1.0.x.
If anonymous mode doesn't stop unwanted leakage on Mint there's nothing I can do. Libtorrent 0.16.x doesn't expose the other option.
Thanks as always for the speedy reply. I have done some testing with Wireshark this morning and can happily confirm that the latest stable version 3.1.12 works properly. When disconnecting the VPN, the traffic dwindled to zero and no packets were routed via another interface. Upon restarting qBt however, the logs show tun0 doesn't exist so it starts happily downloading over eth0 instead.
18/03/2015 12:34:50 - External IP: MY_WAN_IP
18/03/2015 12:34:50 - '/home/USER/.local/share/data/qBittorrent/BT_backup/b415c913643e5ff49fe37d304bbb5e6e11ad5101.torrent' resumed. (fast resume)
18/03/2015 12:34:49 - Options were saved successfully.
18/03/2015 12:34:49 - Embedded Tracker [ON]
18/03/2015 12:34:49 - Encryption support [ON]
18/03/2015 12:34:49 - Local Peer Discovery support [ON]
18/03/2015 12:34:49 - PeX support [ON]
18/03/2015 12:34:49 - DHT support [ON], port: UDP/33155
18/03/2015 12:34:49 - Anonymous mode [OFF]
18/03/2015 12:34:49 - HTTP user agent is qBittorrent v3.1.12
18/03/2015 12:34:49 - UPnP / NAT-PMP support [OFF]
18/03/2015 12:34:49 - The network interface defined is invalid: tun0
Maybe this was part of the issue defined by the guys over at the VPN forum. I'll post there and get them to join here to explain further as this isn't 'my' issue. Many thanks.
When disconnecting the VPN, the traffic dwindled to zero and no packets were routed via another interface
Then the transfer stops immediately. It's just a GUI thing that you see speed numbers. Internally we take speed samples at regular intervals and we average them before showing a speed. So when the transfer suddenly stops the internal queue has some speed samples from previous sampling and its constantly averaging down until it reaches zero.
Upon restarting qBt however, the logs show tun0 doesn't exist so it starts happily downloading over eth0 instead.
You could open a bug report describing in detail the problem at bugs.qbittorrent.org
qbt could theoritically display a message when the configured interface is missing and just start using the first one available.
[quote="sledgehammer_999"]
You could open a bug report describing in detail the problem at bugs.qbittorrent.org
qbt could theoritically display a message when the configured interface is missing and just start using the first one available.
[/quote]
Thanks again for the replies. It would be much better (and safer) if qbt simply popped up an error to say that the specified interface didn't exist, and to not connect to any trackers or peers etc until the user had either reconnected the VPN (in this case), or else chosen to use a different interface. I'll post a bug as requested. Thanks again!