Windows 10/11 CLI commands for checking VPN connection and which portal

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Windows 10/11 CLI commands for checking VPN connection and which portal

L0 Member

I have several applications I run on my computer.  They require that i am VPN'ed into my company since they use servers on the corporate network.  Is there a way to add a check when launching one of these programs (I'm thinking writing a windows batch file to accommodate this) that will check to see that I am connected to VPN via GlobalProtect and confirm i am on the correct Corporate Network (Portal)??  i am currently running windows 10 and GlobalProtect version 5.2.5-84

 

thank you in advance for your help

1 REPLY 1

Cyber Elite
Cyber Elite

Hi @SE_Guru ,

 

Unfortunately GlobalProtect doesn't have any official CLI tool on Windows.

For me theeasiest way to check if GlobalProtect  is connected over CLI is:
- Check ipconfig/network interfaces and see if PANGP interface has assigned IP address

- Check routing table (route print) and confirm the required route is pointing to tunnel (either look for default route or for specific route if you use split tunnel)

 

With above simple checks you should be able to detect which GP portal/gateway are you using - based on the IP range that is assigned ( I would expect to receive different IP ranges when connected to different gateways).

Another way is to check the following registry
HKEY_LOCAL_MACHINE\SOFTWARE\Palo Alto Networks\GlobalProtect\PanSetup

To be honest I am not sure if this registry is not used only for persistence, meaning that I am not sure if you will see different portal address if you switch portals.

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!