Skip to main content

How to Test Port Forwarding on Linux - Knowledgebase / Frequently Asked Questions - PIA Support Portal

How to Test Port Forwarding on Linux

Authors list

To test and ensure that Port Forwarding has been successfully enabled and the provided port is being forwarded, you can conduct the test below for verification. 

 On the device where you have enabled Port Forwarding, after connecting to the VPN and receiving a port, you will enter this command in the Terminal: 

ncat -l <remote port>

Then hit enter. After hitting enter, there will not be any output, this means the test is ready to go: 

Note: If the ‘ncat’ command does not work, you may need to install it on your system as it may not be installed by default. You may also wish to try the command `nc -l <remote port>`


After this, use a second device not connected to your network.  We recommend using your phone, connected to mobile data.  It is very important that the second device is using a different network, if you use the same, the test will not return any results.  Open a browser on your second device and enter the following URL 

http://<VPN IP>:<Forwarded Port> 

Then hit enter. If you get output in the Terminal on the VPN enabled device, then Port Forwarding is working: