To allow users to use the port forwarding feature outside of the PIA app for router-based or manual setups, PIA provides a script that you can use to request a port.
This project is a work in progress, and updates may change its behavior as development continues. The steps below apply to release v0.1.0.
The following steps are for the release of v.0.1.0 and can be found here.
Automated setup of VPN and/or PortForwarding
To help you use VPN services and port forwarding on any device, PIA provides several bash scripts to support the setup process. The scripts include comments that explain how each part works in detail in case you need additional technical information.
Here is a list of scripts you could find useful:
- Get the best region and a token: This script helps you to get the best region and also to get a token for VPN authentication. The script will extend its functionality if you add extra environment variables. Adding your PIA credentials will allow the script to also get a VPN token. The script can also trigger the WireGuard script to create a connection if you specify
PIA_AUTOCONNECT=wireguard. -
Connect to WireGuard: This script allows you to connect to the VPN server via WireGuard. You can specify
PIA_PF=trueIf you also wish to get Port Forwarding for your connection. - Connect to OpenVPN: We are still working on this script.
- Enable Port Forwarding: Enables you to add Port Forwarding to an existing VPN connection.
Manual setup of PF
To use port forwarding on the Next Generation Network, you first need to establish a connection using your selected protocol. After the connection is established, you must find the private IP address of the gateway you are connected to.
If you use WireGuard, the gateway is included in the JSON response you receive from the server, as shown in the bash script. If you use OpenVPN, you can find the gateway by checking the routing table with ip route s t all.
For more information regarding this setup, please reference the following support article. As always, should you experience any issues with port-forwarding, please don't hesitate to reach out to our support team via chat or by submitting a ticket here.