Adding a VPN server to the client from a command line

Christopher Dakin

The LogonBox branded VPN client will default to asking the end user to add the server to connect to.

You may wish to add this for your users automatically via a script.

This article shows how you can use the LogonBox CLI client to add this configuration.


1. Adding a VPN server from the command line

Open a terminal or command line on the client system after the LogonBox VPN client has been installed (or you can run the configure command from a script) and change to the install directly.

I.e for Windows: cd \Program Files\LogonBox\VPN Client

Then you can add a new host configuration with: logonbox-vpn-cli.exe create -sn -m=CLIENT https://yourvpnaddress

 

The available options on the create command are:

-b, --background: Connect in the background and return immediately, only recommended if you want the connection to start now and you are the user of this client, as this will prompt for authentication
-c, --connect-at-startup: Have this connection activated when the service starts. Only use if you want the VPN to connect on boot (note the client may not auto-reconnect if a new authentication is required)
-m, --mode=<mode>: The mode of connection. This should be -m=CLIENT for all normal user connections
-n, --dont-connect-now: Just create the connection, don't connect yet. Recommended for silent configuration
-s, --stay-connected: Stay connected. Will the client attempt to automatically reconnect if its connection is interrupted. Recommended for all installs