Errors Setting IPVanish VPN to Only Use qBittorrent

I’m trying to use this guide to have IPVanish use qBittorrent and nothing else on Windows 10. However, during Part 2, I encounter errors (relevant files shown below). Is this even possible to do with IPVanish, or is the guide wrong in some way? If this method isn’t possible, is there another way to get the results I’m looking for?

My up.bat, down.bat, and pass.txt are configured as shown in the guide (pass.txt has my actual credentials).

My .opvn file looks like this:

client
dev tun
proto udp
remote cle-c01.ipvanish.com 443
resolv-retry infinite
nobind
persist-key
persist-tun
persist-remote-ip
ca ca.ipvanish.com.crt
verify-x509-name cle-c01.ipvanish.com name
auth-user-pass
comp-lzo
verb 3
auth SHA256
cipher AES-256-CBC
keysize 256
tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA:TLS-DHE-DSS-WITH-AES-256-CBC-SHA:TLS-RSA-WITH-AES-256-CBC-SHA

auth-user-pass pass.txt
script-security 2
route-noexec
up up.bat
down down.bat

My log file looks like this:

Wed May 30 12:36:53 2018 WARNING: --keysize is DEPRECATED and will be removed in OpenVPN 2.6
Wed May 30 12:36:53 2018 OpenVPN 2.4.6 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Apr 26 2018
Wed May 30 12:36:53 2018 Windows version 6.2 (Windows 8 or greater) 64bit
Wed May 30 12:36:53 2018 library versions: OpenSSL 1.1.0h  27 Mar 2018, LZO 2.10
Enter Management Password:
Wed May 30 12:36:53 2018 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Wed May 30 12:36:53 2018 Need hold release from management interface, waiting...
Wed May 30 12:36:54 2018 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Wed May 30 12:36:54 2018 MANAGEMENT: CMD 'state on'
Wed May 30 12:36:54 2018 MANAGEMENT: CMD 'log all on'
Wed May 30 12:36:54 2018 MANAGEMENT: CMD 'echo all on'
Wed May 30 12:36:54 2018 MANAGEMENT: CMD 'bytecount 5'
Wed May 30 12:36:54 2018 MANAGEMENT: CMD 'hold off'
Wed May 30 12:36:54 2018 MANAGEMENT: CMD 'hold release'
Wed May 30 12:36:54 2018 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Wed May 30 12:36:54 2018 MANAGEMENT: >STATE:1527698214,RESOLVE,,,,,,
Wed May 30 12:36:54 2018 TCP/UDP: Preserving recently used remote address: [AF_INET]66.171.36.85:443
Wed May 30 12:36:54 2018 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed May 30 12:36:54 2018 UDP link local: (not bound)
Wed May 30 12:36:54 2018 UDP link remote: [AF_INET]66.171.36.85:443
Wed May 30 12:36:54 2018 MANAGEMENT: >STATE:1527698214,WAIT,,,,,,
Wed May 30 12:36:54 2018 MANAGEMENT: >STATE:1527698214,AUTH,,,,,,
Wed May 30 12:36:54 2018 TLS: Initial packet from [AF_INET]66.171.36.85:443, sid=e56ee356 24fa1ac1
Wed May 30 12:36:54 2018 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Wed May 30 12:36:54 2018 VERIFY OK: depth=1, C=US, ST=FL, L=Winter Park, O=IPVanish, OU=IPVanish VPN, CN=IPVanish CA, [email protected]
Wed May 30 12:36:54 2018 VERIFY X509NAME OK: C=US, ST=FL, L=Winter Park, O=IPVanish, OU=IPVanish VPN, CN=cle-c01.ipvanish.com, [email protected]
Wed May 30 12:36:54 2018 VERIFY OK: depth=0, C=US, ST=FL, L=Winter Park, O=IPVanish, OU=IPVanish VPN, CN=cle-c01.ipvanish.com, [email protected]
Wed May 30 12:36:54 2018 Control Channel: TLSv1.2, cipher SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Wed May 30 12:36:54 2018 [cle-c01.ipvanish.com] Peer Connection Initiated with [AF_INET]66.171.36.85:443
Wed May 30 12:36:56 2018 MANAGEMENT: >STATE:1527698216,GET_CONFIG,,,,,,
Wed May 30 12:36:56 2018 SENT CONTROL [cle-c01.ipvanish.com]: 'PUSH_REQUEST' (status=1)
Wed May 30 12:36:56 2018 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 198.18.0.1,dhcp-option DNS 198.18.0.2,rcvbuf 493216,sndbuf 493216,explicit-exit-notify 5,route-gateway 172.21.24.1,topology subnet,ping 20,ping-restart 40,ifconfig 172.21.24.154 255.255.254.0,peer-id 11,cipher AES-256-GCM'
Wed May 30 12:36:56 2018 OPTIONS IMPORT: timers and/or timeouts modified
Wed May 30 12:36:56 2018 OPTIONS IMPORT: explicit notify parm(s) modified
Wed May 30 12:36:56 2018 OPTIONS IMPORT: --sndbuf/--rcvbuf options modified
Wed May 30 12:36:56 2018 Socket Buffers: R=[65536->493216] S=[65536->493216]
Wed May 30 12:36:56 2018 OPTIONS IMPORT: --ifconfig/up options modified
Wed May 30 12:36:56 2018 OPTIONS IMPORT: route options modified
Wed May 30 12:36:56 2018 OPTIONS IMPORT: route-related options modified
Wed May 30 12:36:56 2018 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Wed May 30 12:36:56 2018 OPTIONS IMPORT: peer-id set
Wed May 30 12:36:56 2018 OPTIONS IMPORT: adjusting link_mtu to 1625
Wed May 30 12:36:56 2018 OPTIONS IMPORT: data channel crypto options modified
Wed May 30 12:36:56 2018 Data Channel: using negotiated cipher 'AES-256-GCM'
Wed May 30 12:36:56 2018 NCP: overriding user-set keysize with default
Wed May 30 12:36:56 2018 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed May 30 12:36:56 2018 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed May 30 12:36:56 2018 interactive service msg_channel=0
Wed May 30 12:36:56 2018 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 I=17 HWADDR=5c:ea:1d:6f:5d:71
Wed May 30 12:36:56 2018 open_tun
Wed May 30 12:36:56 2018 TAP-WIN32 device [Ethernet 2] opened: \\.\Global\{89FD7BF7-4683-4780-B24E-F24BB27AD53F}.tap
Wed May 30 12:36:56 2018 TAP-Windows Driver Version 9.21 
Wed May 30 12:36:56 2018 Set TAP-Windows TUN subnet mode network/local/netmask = 172.21.24.0/172.21.24.154/255.255.254.0 [SUCCEEDED]
Wed May 30 12:36:56 2018 Notified TAP-Windows driver to set a DHCP IP/netmask of 172.21.24.154/255.255.254.0 on interface {89FD7BF7-4683-4780-B24E-F24BB27AD53F} [DHCP-serv: 172.21.25.254, lease-time: 31536000]
Wed May 30 12:36:56 2018 Successful ARP Flush on interface [50] {89FD7BF7-4683-4780-B24E-F24BB27AD53F}
Wed May 30 12:36:56 2018 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Wed May 30 12:36:56 2018 MANAGEMENT: >STATE:1527698216,ASSIGN_IP,,172.21.24.154,,,,
Wed May 30 12:36:56 2018 up.bat Ethernet 2 1500 1553 172.21.24.154 255.255.254.0 init
Wed May 30 12:36:56 2018 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Wed May 30 12:36:56 2018 MANAGEMENT: Client disconnected
Wed May 30 12:36:56 2018 WARNING: Failed running command (--up/--down): returned error code 1
Wed May 30 12:36:56 2018 Exiting due to fatal error

Try to add “exit 0” (without the quotation marks) at the end of both files up.bat and down.bat! Because OpenVPN expect a return code of 0 (no error) for a command, it could be just a common mistake. I think about that because of the “returned error code 1” message. Please read this for a longuer explanation about return code: Batch Script - Return Code

Generally, all VPNs always work on the entire network and not just the torrent client.

All that does is suppress the errors. It doesn’t seem to allow the command. I may be wrong, but I think some commands changed somewhere, and they now cause syntax errors.

Normally, yes. What following the guide is supposed to do is only make it work for the selected application (qBittorrent in this case). My problem is IPVanish VPN doesn’t connect when I do this, even though it should be able to at that point in the guide (it mentions testing torrent IP addresses and such).

Do you have the same error exiting with fatal error? When I follow the exact same steps from the guide you specified I can connect to my VPN and I do not get any error. Moreover, if I verify with doileak my ISP is recognized! However, if I apply DNS advices from the part2/step 7 none website can be found. I do not have times now to do more tests but except the DNS problem it should works.

I’ve never seen it work that way to my knowledge.

I made a last test before I leave and if your remove the line “block-outside-dns” from your .ovpn file it should works! Tested on Win10 with PIA and last OpenVPN GUI 11.

I don’t even get that far before stuff fails. Could you send me the text of your up.bat, down.bat, and .ovpn files (personal details removed of course)?

Maybe the technique is unworkable with IPVanish. Is there any way to check that?

You can download my files here: Rapidgator: Buy premium account
There is no confidential informations! I can’t solve de DNS problem whatever the commands I tried. With this files, I can start the VPN session and when I verify my IP address with ipleak my ISP address is returned. If you start a DOS window AFTER the connection and enter “ipconfig /all” then “route print -4” you wil found informations from both networks but the VPN session is NOT able to resolve any name! Even if I can see the two DNS server address correctly defined on the TAP device! I don’t know why and it’s frustrating. :frowning:

I used your up.bat and down.bat files, and the guide’s commands in my .ovpn file, and here’s what I found. qBittorrent is set to the correct interface (Ethernet 2 in my case), and “Use UPnP/NAT-PMP port forwarding from my router” is enabled. I am running OpenVPN GUI as administrator.

The VPN states a successful connection. My normal web traffic doesn’t go though the VPN (sites still show my normal IP). Torrent address tests never resolve through qBittorrent, and the test Ubuntu torrent shows as stalled. Additionally, when I disconnect from the VPN, my Wi-Fi shows no internet connection, which is fixed by disconnecting and reconnecting to my Wi-Fi.

What I think (not a networking pro here) is, for whatever reason, the low-priority route to the VPN is not being created correctly in the up.bat, so the interface doesn’t actually connect to anything. qBittorrent, connecting only through the VPN, has no route to the internet. And when I disconnect from the VPN, the down.bat command screws stuff up, which is reset on a reconnect.

If this method of using a VPN only for qBittorrent doesn’t end up working for me, are there any others?

This is the same problem I encountered. When I look at both networks using ipconfig /all and route print -4 everything looks good but the BitTorrent client is not able to resolve tracker names. I don’t know if it’s possible to make it work under Windows that’s why I buyed a NAS to create a small seedbox. This way your VPN is used only by the NAS and you don’t have any config problem!