This guide goes over everything you need for setting up AirVPN on Windows with ports for Plex and qBittorrent as well as optionally installing WireSock client for users who want app split tunneling.
*The original guide was deleted so I’m reposting since people are still looking for it.*
Create your AirVPN ports:
- Login to AirVPN and create your devices (e.g., PC-1, Mobile-2, etc.).
- Visit https://airvpn.org/ports/ and request a new port for Plex and qBittorrent.
- In the notes section, name them as Plex and qBit.
- In the device section, select the device you created from step 1.
- For the Plex port, set the protocol to TCP only, and leave the rest of the settings as default.
If you don’t need app split tunneling you can download and install the AirVPN windows client https://airvpn.org/download/, then skip the optional steps below.
Otherwise see the following sections for setting up WireSock.
(Optional) Setup WireSock, WireSockUI, and your WireGuard config files:
- Download and install WireSock: https://www.wiresock.net/
- Download WireSockUI: https://github.com/wiresock/WireSockUI/releases. For Windows 10/11 users, download the AnyCPU .zip file. For older systems (Windows 7/8), download the AnyCPU no-uwp .zip file.
- Extract the files to a folder of your choice. Note that there is no installer for WireSockUI.
- Open the “WireSockUI.exe.config” file in a text editor (e.g., Notepad++) and set the following fields to True: AutoConnect, AutoRun, AutoMinimize, AutoUpdate, UseAdapter.
- Generate your WireGuard config files by going to https://airvpn.org/generator/. Select Wireguard and choose your device. Select the servers you want to connect to and download the config files. My recommendation would be to download a config for your country and also all the configs for the city nearest to you. The nearest city will almost always give the best performance. If you have fast internet (1gbs+) I would recommend also downloading the config for the nearest 10gbit server.
- Extract the config files to a temporary folder for editing. Open them in a text editor like Notepad++.
- To allow local connections (e.g., Plex), add the line
DisallowedIPs = 192.168.0.0/24
under the “AllowedIPs” line in each config file. If your subnet is something other than 192.168… then you can change it accordingly. If you’re not sure what to enter here you can useipconfig
in command prompt to find your default gateway. Add any other IPs here that you want to run outside the VPN connection. Note, the block192.168.0.0/24
would include all IPs between192.168.0.0 - 192.168.0.255
. So if you have a different subnet address such as192.168.1.0
or you need to open different IP ranges you can use this tool to help you figure out which block to use. Your subnet is generally the IP you use to login to your router followed by/24
. - To exclude specific apps or folders from the VPN connection, add a line at the bottom of the config file:
DisallowedApps = C:\path\to\file1.exe, C:\path\to\file2.exe, C:\path\to\folder1\, C:\path\to\folder2\
. One thing I like to exclude is the windows printer service:C:\Windows\System32\spoolsv.exe
. If you’re a gamer, some other ones you can add are the Steam and Epic Games folders:C:\Program Files\Steam\steamapps\common\, C:\Program Files\Epic Games\
. - Save the edited config files.
- Run “WireSockUI.exe”.
- Add a tunnel and import all your config files.
- Once imported, you can delete the original config files as they will have been copied to a new folder.
- To edit the new config files, open the config files folder at the bottom right of the WireSockUI menu.
- Open the settings menu in WireSockUI and ensure the following fields are enabled: AutoConnect, AutoRun, AutoMinimize, AutoUpdate, UseAdapter. Click Save.
- You can now connect to the VPN by selecting any of your config files and clicking “Activate”.
- To switch between servers, right-click the WireSock icon in the system tray.
Binding your network interface in qBittorrent:
- Open qBittorrent and go to Options > Advanced > Network Interface.
- For WireSock set the network adapter to “Local Area Connection” or “WireSock”.
- For AirVPN client it might be any variation of the following: Local Area Connection, Network Connection 3, utun0, tun1, TAP-windows adapter etc. (maybe someone could post in the comments what it was for you)
- To verify that it’s working correctly, you can use tools like https://ipleak.net/, http://checkmyip.torrentprivacy.com/, https://www.whatismyip.net/tools/torrent-ip-checker/, or legal torrents. When WireSock is not connected, all connections in qBit should stop.
Add your ports to Plex and qBittorrent:
- In your Plex remote access settings, add the port assigned to you.
- In qBittorrent, go to options > connection and add the port assigned to you.
Add a Windows firewall rule for your Plex port:
- Click on the Windows icon.
- Type wf.msc and hit Enter.
- Click on Inbound Rules.
- Under the Actions column, click on New Rule.
- Select Port, then click Next.
- Select TCP and Specific local ports.
- Enter the port number you were assigned, then click Next.
- Select Allow the connection, then click Next.
- Check the boxes next to Private and Public, then click Next.
- Enter a name, for example “Plex port XXXXX”, then click Finish.
Other notes (setting up standard WireGuard config files for mobile):
One other thing I wanted to mention is this tool which can help you setup regular wireguard config files for mobile to allow local connections for Plex. Since the regular Wireguard client doesn’t support the DisallowedIPs
and DisallowedApps
field you will need to use the tool to help you calculate what should be entered in the AllowedIPs
field in order to allow local connections on mobile.
For example, in the tool you could enter AllowedIPs: 0.0.0.0/0, ::/0
which would send everything through VPN. Then in the DisallowedIPs field enter your subnet block e.g. 192.168.0.0/24
which would allow local connections on mobile (e.g. connecting to Plex). The tool would then generate the AllowedIPs field as follows: AllowedIPs = 0.0.0.0/1, 128.0.0.0/2, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.1.0/24, 192.168.2.0/23, 192.168.4.0/22, 192.168.8.0/21, 192.168.16.0/20, 192.168.32.0/19, 192.168.64.0/18, 192.168.128.0/17, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, 224.0.0.0/3, ::/0
. Then you would save the config files and import them using the Wireguard mobile app (Android, iOS). Note, the Wireguard mobile app requires the config file names to be very short, so you will need to rename the config files to something like WG_US_1.conf, WG_NY_2.conf, Air_FL_3.conf, etc.