Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Windows Guide: Enabling your vPN for a single program while letting everything else use your normal connection.
- This guide was orignally written by myself in a thread on r/piracy, however i think many people would like a setup like this, hence this post.
- Essentially this setup will let you run your VPN at all times without worrying about high ping in online games and the like, as only one (or more if you want) program will be using your VPN while the rest will be using your normal connection.
- I learned how to set this up by experimenting as there was no guide for doing this on Windows on the internet last time i checked. Please send a link to such a guide if you find one, it might be better than mine :)
- This guide is written for use with qBittorrent and privateinternetaccess(PIA) VPN, but the VPN provider doesn't matter alot as long as your VPN has config files that you can download for use with OpenVPN. I strongly recommend using qBittorrent as it can bind to a network interface which will become very useful later in the guide.
- Part 1, Setting up OpenVPN:
- Step 1 you need to use Openvpn instead of the PIA app. This gives us much more customizabilty and as far as i know the PIA app is built on openvpn anyways. So have Openvpn installed.
- Step 2 you need to get the openvpn config files for PIA from PIA's website
- Step 3 place the ".pem", ".ca" and one (Choose best location for you) of the ".ovpn" files in "C:\Program Files\OpenVPN\config" like so: http://i.imgur.com/1xZZAb5.png
- Step 4 create a file called pass.txt in the same folder and insert your PIA username and password on two lines like so: http://i.imgur.com/Wpef5bP.png
- Step 5 insert into the ".ovpn" file you placed in the "C:\Program Files\OpenVPN\config" folder: auth-user-pass pass.txt
- Now you should be able to start Openvpn GUI, right click the icon in the taskbar and press connect and this will connect you to PIA servers with the Openvpn client instead of the PIA client.
- Check if your IP has changed with https://ipleak.net or https://www.doileak.com/
- Part 2, Setting network routes:
- Step 1 Add these lines to the ".ovpn" file:
- script-security 2
- route-noexec
- up up.bat
- down down.bat
- Step 2 create an "up.bat" and a "down.bat" in the config folder like so: http://i.imgur.com/k9mvC9g.png
- Step 3 insert into the "up.bat":
- ROUTE ADD 0.0.0.0 MASK 0.0.0.0 %ifconfig_remote%
- Step 4 insert into the "down.bat":
- ROUTE DELETE 0.0.0.0 MASK 0.0.0.0 %ifconfig_remote%
- Step 5 This part is why using qBittorrent is a very good idea for this sort of setup but if you really don't want to switch you'll have to find a way to bind your torrent client to a network interface.
- Open qBittorrent and go into settings, and then "advanced". Then you want to set the network interface to your VPN interface like so: http://i.imgur.com/T6y4B1P.png
- This will make qBittorrent communcate via the VPN and ONLY the VPN, in my experience. This means that if the VPN tunnel goes down, qBittorrent will lose connection instead of connecting with your real IP. You will have to restart qBittorrent every time the VPN is restarted to connect to the new VPN ip though. (Make sure you have exited qBittorrent in the taskbar when restarting it).
- Step 6 Try going to https://doileak.com and activate the torrent test. Add the magnet links to qBittorrent and start the test. If it worked the "Request IP" should be different from the "Torrent HTTP Request IP" and the "Torrent UDP Request IP"
- Maybe you have noticed that qBittorrent is still using some of your non-VPN DNS servers though.
- Step 7 My best solution to the DNS server problem is making everything on your PC use OpenDNS DNS servers instead of your ISP's or your VPN's. To do this add these lines to the ".ovpn" file:
- dhcp-option DNS 208.67.222.222
- dhcp-option DNS 208.67.220.220
- block-outside-dns
- Check with https://doileak.com again, all your dns requests from qBittorrent and from your browser should now come from OpenDNS making it harder (to the best of my knowledge) to correlate your normal IP with your VPN IP.
- If you experience any issues with your DNS servers cutting out, remove these 3 lines again. I have only had these issues on one of the 2 PC's i use with this setup.
- Step 8 Start OpenVPN as a service.
- Go into Services in Windows.
- Find OpenVPN Service and go into it's properties.
- Set Startup type to automatic, press apply and press start. OpenVPN should now run in the background at all times.
- PART 3, Making qBittorrent start and stop automatically with the VPN:
- A command to start and stop qBittorrent can be added to the up.bat and down.bat files. This is neat because qBittorrent has to be restarted every time the VPN restarts and by adding it to the bat files you don't have to do it manually. However, when using openvpn as a service it doesn't start qBittorrent the same way as if you had started it yourself (because of the way services are handled in Windows).
- Therefore it will not appear as "desktop program" but will still be running in the background.
- This means that the only way to access qBittorrent is through the WebUI.
- The command to add to "up.bat" is:
- start /d "C:\Program Files (x86)\qBittorrent" qbittorrent.exe
- http://i.imgur.com/IJCiGr3.png
- The command to add to "down.bat" is:
- taskkill /F /IM "qbittorrent.exe"
- http://i.imgur.com/zDeb43M.png
- Then there is a couple a steps you need to take to make sure the OpenVPN Service is logged in as your user:
- Step 1 Go to services, right click OpenVPN Service and go to properties.
- Step 2 In the "Log On" tab press "this account" and click browse.
- Step 3 Press advanced and a large window will popup.
- Step 4 In the large windows press find now and a list of users will appear at the bottom of the window.
- It should look like this: http://i.imgur.com/jxrH3i9.png
- Step 5 Double click your username("Hundter" in my case) in the list.
- Step 6 Press Ok to close the large window. Press Ok again to close the smaller window. Your username should now be in the box next to "This account".
- Step 7 Enter the password for the user in Password and Confirm Password and press Ok.
- Assuming that you have enabled WebUI in qBittorrent you should be able to access the WebUI without starting qBittorrent yourself as long as the VPN is running.
- Assuming you followed the guide you should now have an amazing VPN setup (in my opinion) that will let you use your PC for gaming, browsing and other activites where low latency or direct connection is preferred :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement