Globalprotect VPN Batch File or C # Code

Hey. I am trying to connect to a VPN network using the GlobalProtect VPN client. I can do this using the user interface, but I would like it to be automated. In another project in which I used Sonicwall Netextender, I created a batch file that I called from my C # code, so I connected to the VPN, calling the batch file, performed some operations and disconnected using another batch file. I am trying to find a similar way to achieve it using Globalprotect. The command line arguments that I used with Netextender do not seem to work with PanGPA.exe. Any ideas how I could do this? So far I have been out of luck with the batch file. Netextender batch file:

cd c:\Program Files (x86)\SonicWALL\SSL-VPN\NetExtender\ NECLI connect -s 122.254.213.256 -d DNAME -u UNAME -p PASSWORD 
+5
source share
2 answers

There is such automation with globalprotect VPN client

+3
source

Update: just use OpenConnect v8.00 or later. GlobalProtect support has been included in the "official" OpenConnect builds since version 8.00 . So GP support will be Just Work ™ with a recent official build.

---

You cannot do this with an official GP client. However, I recently expanded the fantastic OpenConnect open source VPN VPN client to support the GlobalProtect VPN PAN in SSL-VPN and IPsec / ESP modes. It acts as its own client, and you can run it from the command line completely automatically.

This is work in progress , but I am already using it for real work, and it works very well for me. It would be nice if other people checked it out and I would be happy for your feedback!

You will need to collect the globalprotect branch from this repository: https://github.com/dlenski/openconnect

... and then run it to verify it (you can omit the --certificate part if your VPN does not use a client certificate):

 echo password | openconnect --user username --passwd-on-stdin \ --protocol=gp [--certificate=my_cert_with_pk.pem] \ gp-gateway-server.company.com --dump -vvv 

(I have not tested this assembly under Windows yet, but the official OpenConnect assemblies are fully compatible with Windows, and there is nothing special about it.)

+3
source

Source: https://habr.com/ru/post/1239810/


All Articles