Configure qBittorrent to block transfers on VPN disconnect

Martin Brinkmann
Mar 23, 2016
Internet
|
27

If you are using a virtual private network while downloading torrents, then you may be interested in an option that qBittorrent makes available that blocks transfers automatically if the VPN connection drops.

VPNs are useful to improve your privacy on the Internet but like any other connection, they may disconnect from time to time.

While some services come with kill switches that prevent data transfers until the VPN connection has been established again, it is not the case for all and usually only available if you use a program provided by the VPN to connect to it but not if you use the operating system's build-in functionality to do so.

qBittorrent and VPNs

qbittorrent kill connection

One feature of qBittorrent, a popular cross-platform torrent client, is such a kill switch. Basically, what it does, is monitor a specific network connection to block all file transfers (up and down) if the network connection changes.

This can be useful to block torrent traffic if the connection to the VPN terminates, but also for other things like making sure that torrents are only downloaded or uploaded when the device is connected to a specific network adapter (say only when it is connected to Ethernet and not Wifi).

Here is what you need to do to configure the feature:

First thing you need to do is find out how the network connection / adapter that you want qBittorrent to use exclusively is named.

If you know that already, skip the following step.

  1. Use Windows-Pause to open the Windows Control Panel.
  2. Select Control Panel Home on the screen that opens.
  3. Select Network and Internet from the selection menu.
  4. Click on Network and Sharing Center on the next page.
  5. Select change adapter settings.
  6. There you find listed all network connections. Identify the one used by the VPN.

Once you know the name of the network connection, you may set up qBittorrent to use it exclusively.

  1. Open the qBittorrent program on your system.
  2. Select Tools > Options, or use the shortcut Ctrl-O to do the same.
  3. Switch to the advanced listing.
  4. Scroll down until you find "network interface" listed as a setting.
  5. Click on "any interface", and switch the value to the network connection you have identified previously.
  6. Click apply and ok.
  7. Restart qBittorrent.

It may be a good idea to test the setting to make sure it works correctly. What you can do is use a different connection, e.g. no vPN connection and start the program to see if traffic is blocked. Or, and that may be even better, start qBittorrent connected to the exclusive network connection you have configured, and terminate that connection after a moment to see if the BitTorrent client will block all traffic. (Thanks Don)

 

Summary
Configure qBittorrent to block transfers on VPN disconnect
Article Name
Configure qBittorrent to block transfers on VPN disconnect
Description
Find out how to configure qBittorrent to use a network connection exclusively, for instance to make sure that it will always use a VPN connection for torrenting.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. Anonymous said on March 21, 2023 at 5:58 pm
    Reply

    Got a call from my ISP even though I was using my VPN. I’m hopeful this method prevents any torrenting if coming from my ISP’s routing. They told m the exact things I was downloading and the times. Has anyone here been called by their ISP even using a VPN?

  2. Anonymous said on October 3, 2021 at 7:42 pm
    Reply

    Tried this on linux Mint 20.2 with qbitorrent v4.1.7, my VPN was “tun0” and I tested disconnecting the VPN and indeed the torrents “Stalled” and qbitorrent even notified me that the network had been disconnected. Which is perfect!

    There’s a problem though… When I re-enabled the VPN, qbittorent never resumed the torrents, there were all “stalled”, I waited a couple of minutes but I ended up having to resume them manually (I did a “force re-announce”). Surely it should resume automatically once the VPN “tun0” is up and running?

  3. dynamichael said on June 30, 2021 at 6:30 am
    Reply

    Great. Works. Now how do you get qBittorrent to resume downloading once the VPN connection is re-established? I have to restart the program every time.

  4. twister said on March 24, 2021 at 5:18 pm
    Reply

    Awesome! Thank you for this! Still a great solution in March 2021. VPN disconnected when I was asleep which caused problems with my ISP. Problem solved.

  5. simo8 said on November 3, 2020 at 4:20 am
    Reply

    I just wanna say THANK you for the best and most simple explanation of fthe easiest way to do it, Much appreciated from a linux user.

  6. Block&Delete said on October 3, 2020 at 4:20 pm
    Reply

    Forget it there are others that are working fine have done for years why even bother with all this bull. The thing is a pain in the we binned it, when it cuts of the net its a piece of shit. The net is full of crap programs & this is one of them

  7. Luiz said on October 2, 2020 at 7:18 am
    Reply

    First time I tried this it works fine. But know I keep doing the same think but qbitorrent doesnt work for nothing! I have lost 2 hours of my life with this issue so i’m so frustrated and angry. I uninstalled it more than once, reinitiate windows, check firewall. Nothing works.

  8. Muhammad said on May 7, 2020 at 2:47 pm
    Reply

    I’ve just set this up using AirVPN and it works perfectly :)

  9. Mark F said on May 4, 2020 at 12:54 am
    Reply

    Worked perfectly – thank you!

  10. Tommy said on September 25, 2019 at 11:12 am
    Reply

    This is a game changer, thank you.

  11. sumjerk said on December 23, 2018 at 8:25 pm
    Reply

    I can’t believe all the things I tried to get this outcome only to find this solution weeks later… and it’s this simple. SMH! thank you. (I’ll check out that ip6 thing too.)

  12. Anonymous said on August 1, 2018 at 5:10 am
    Reply

    This was truly a lifesaver. I understand there are other risks and probably plenty of other things I need to research in order to be secure, but this is a great start. Thank you

  13. RB said on April 22, 2018 at 1:45 am
    Reply

    Help Please..

    I am using a Free VPN in FireFox called “SETUPVPN”

    Can someone please advise how to configure qBbitorrent with SETUPVPN.

    SETUPVPN. it is an extension for Firefox and works quite well. However I require Kill Switch capability.

    Thank you in advance!!!!!!!!

    RB

    Thanks in advance,

    Ron

  14. Bill said on October 10, 2017 at 6:52 am
    Reply

    Warning: if using windows, THIS DOES NOT WORK IF YOU HAVE IPV6 ENABLED ON YOUR SYSTEM.
    It seems that bittorrent does not respect the interface binding setting if ipv6 is enabled.

    You can test this by using the ipleak.net Torrent Leak detection (to check the kill switch, do this while your VPN is disabled):

    – if only ipv4 is enabled on your system and the interface is properly configured on qBittorrent, you will not be detected (while the VPN is down, no data goes through)

    – if ipv6 is enabled, ipleak.net will show your ipv6 address.

  15. TB said on August 24, 2016 at 3:32 pm
    Reply

    Great article – thanks for the tip and walkthrough instructions!

    As an additional suggestion (just to make the process idiot proof) within ‘Adapter Settings’ right click on your VPN adapter connection and Rename the connection something explicit, like “VPN Connection”. Whatever name you give it will show up in qBittorent as a connection option, simplifying the selection process.

  16. Emmy said on April 7, 2016 at 4:55 pm
    Reply

    Does anyone know how do the first steps on a mac?

    1. JB said on September 7, 2020 at 9:32 pm
      Reply

      Copy and pasted from a reddit thread since it took me a while to figure this out:

      Hey, an easy way to do it is to use the ifconfig command to display all active network interfaces. Do it with VPN on, then do it again with VPN off. The missing interface is the VPN.

    2. Martin Brinkmann said on April 7, 2016 at 5:26 pm
      Reply

      Emmy, you could skip the network adapter step as qBittorrent lists them all in its interface. Maybe you can identify the right one there directly.

  17. bm said on March 24, 2016 at 6:02 pm
    Reply

    Have been doing this for some time.

    However, perhaps with the specific VPN provider I use, have found one possible issue / vulnerability…

    If the VPN does not fully disconnect, but it “times out” (in that limbo state similar to when first establishing a connection but before getting an IP address), qbittorrent still seems to be “uploading” (i.e. the Total Upload Graph is not flat, but will have some lifts and even spikes in it, indicating that the magnitude of the amount of sending info has not changed from before the “time out” ).

    Don’t know enough to explain what this is about, but was surprised that all traffic was not completely stopped.

    1. nonW00t said on September 12, 2020 at 10:38 pm
      Reply

      I would think attempts would account for the blips on the graph when down.

  18. jan1973 said on March 24, 2016 at 2:36 pm
    Reply

    Tried it, but I can only choose from wired and wireless networks, the vpns that are availabe on my computer don’t show under network interace in qbittorrent.

    1. Don Gateley said on March 25, 2016 at 1:51 am
      Reply

      Yes, it doesn’t seem to see Windows VPN adapters. I use Private Internet Access which installs a TAP-Windows Adapter connection which its VPN client then uses. That one does appear in the qBittorrent list.

      Although the Private Internet Access client does itself offer a kill switch option it is very problematic in use and can leave your system unable to access the internet at all if the service is not “properly” closed.

  19. neal said on March 24, 2016 at 5:52 am
    Reply

    This of course makes it so you can’t use qbittorent when you aren’t on the VPN. Guess you can’t it both ways of course, or has someone made a qBittorent plugin that detect which network only works for the session? Like if the network you used to connect to for the session is interrupted whether that be your regular or VPN session the client shuts down.

  20. Jason said on March 23, 2016 at 7:45 pm
    Reply

    Didn’t know about this feature. It makes me want to try out qBittorrent again.

    However, the best way to auto-block internet connections when the VPN is down is to use a script in your router, via something like ddwrt or openwrt.

    But I’m all for adding layers of protection!

    1. Sam said on January 21, 2019 at 2:58 am
      Reply

      What qualifies this as ‘the best way to auto-block”? Does it block connections faster? How much faster? If it is faster, does it even matter that it is faster?

  21. peter said on March 23, 2016 at 4:47 pm
    Reply

    I tried to get this to work on Xubuntu 15.10 without any success. It just kept downloading regardless of the interface setting.

    Aparrently it was a bug that was fixed in version 3.2.5. Meanwhile, Ubuntu’s repositories are still stuck at 3.2.3. One way to get a recent version is through the qbittorrent PPA:
    https://launchpad.net/~qbittorrent-team/+archive/ubuntu/qbittorrent-stable

    Now it works for me. Thanks for the article!

  22. DV said on March 23, 2016 at 3:14 pm
    Reply

    I’d be interesting in configuring Transmission the same way on a VPS.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.