Description: Using the openvpn3-as tool, you can download and import a connection profile (.ovpn file) directly from an Access Server. It requires the Access Server IP address or domain and queries the user for authentication credentials before connecting to the server.
Tip: You can use the openvpn3-as tool to download and import connection profiles directly from Access Server for users authenticating with PAM, local, RADIUS, or LDAP methods.
Note: We download and import a user-locked profile in the first example. We provide additional commands for various use cases in the last section.
Before you begin
Ensure you have the latest version of the openvpn3 Linux client by using the below command on your Linux machine:
openvpn3 version
To update or install the client, refer to OpenVPN 3 Linux.
Import a connection profile
Download and import a connection profile (.ovpn file) directly from Access Server:
openvpn3-as --name <MY_CONFIG_NAME> https://myserver.example.net/
Note: Enter your desired file name for <MY_CONFIG_NAME> and replace https://myserver.example.net/ with the Access Server domain name or IP address.
When prompted, enter your username and password.
The openvpn3-as tool imports the file into the OpenVPN3 Linux configuration manager using the file name defined.
Example:
We imported a connection profile and named the file TEST1:
root@Ubuntu-Server:~# openvpn3-as --name TEST1 https://myserver.example.net/
OpenVPN Access Server Username: test1
OpenVPN Access Server Password:
------------------------------------------------------------
Profile imported successfully
Configuration name: TEST1
Configuration path: /net/openvpn/v3/configuration/eab4b532xc007x4c56x8a8bx92adb4f2c8a5
root@Ubuntu-Server:~#
Tip: The <MY_CONFIG_NAME> is an "alias name" associated with your connection profile (.ovpn file).
View imported .ovpn file
You can now see the imported connection profile available.
List all available configuration profiles (including your recently downloaded file):
openvpn3 configs-list
Example:
root@Ubuntu-Server:~# openvpn3 configs-list
Configuration Name Last used
------------------------------------------------------------------------------
TEST1 2023-10-05 14:23:20
------------------------------------------------------------------------------
root@Ubuntu-Server:~#
Connect to the VPN server
You can connect to Access Server.
Connect with your profile:
openvpn3 session-start --config <MY_CONFIG_NAME>
Enter credentials when prompted, and you should connect.
Example:
root@Ubuntu-Server:~# openvpn3 session-start --config TEST1
Using pre-loaded configuration profile 'TEST1'
Session path: /net/openvpn/v3/sessions/f60c861fs439cs48c3s8d4bs6ad9d78deb31
Auth User name: test1
Auth Password:
Connected
root@Ubuntu-Server:~#
Check connection status
You can check your VPN connection status by using the below command:
openvpn3 sessions-list
Example:
root@Ubuntu-Server:~# openvpn3 sessions-list
-----------------------------------------------------------------------------
Path: /net/openvpn/v3/sessions/f60c861fs439cs48c3s8d4bs6ad9d78deb31
Created: Thu Oct 5 14:23:17 2023 PID: 39220
Owner: root Device: tun0
Config name: TEST1
Session name: myserver.example.net
Status: Connection, Client connected
-----------------------------------------------------------------------------
root@Ubuntu-Server:~#
root@Ubuntu-Server:~#
You can check the <MY_CONFIG_NAME> you have configured by using the below command:
openvpn3 configs-list --verbose
Example:
root@Ubuntu-Server:~# openvpn3 configs-list --verbose
Configuration path
Imported Last used Used
Configuration Name Owner
Tags
------------------------------------------------------------------------------
/net/openvpn/v3/configuration/0c35833dx29d1x4e1bx8e08x6f9f15ed6be1
2023-10-05 14:16:23 2023-10-05 14:23:20 1
TEST1 root
Tags: (none)
root@Ubuntu-Server:~#
Additional example commands
Below are some helpful example commands for other use cases.
Download and import a user-locked profile using the Access Server domain name:
openvpn3-as --name <MY_CONFIG_NAME> https://myserver.example.net/
Download and import a user-locked profile using the Access Server IP address:
openvpn3-as --name <MY_CONFIG_NAME> --insecure-certs https://192.0.2.1/
Download and import an auto-login profile using the Access Server domain name:
openvpn3-as --autologin --name <MY_CONFIG_NAME> https://myserver.example.net/
Download and import an auto-login profile using the Access Server IP address:
openvpn3-as --autologin --name <MY_CONFIG_NAME> --insecure-certs https://192.0.2.1/
Download and import an auto-login profile and configure it to make the openvpn3 client for Linux run as a service (automatically connect to VPN at reboot):
openvpn3-as --systemd-start --autologin --name <MY_CONFIG_NAME> https://myserver.example.net/
For more info about what combination and options you can use with the openvpn3-as tool, use the below command:
openvpn3-as --help
You can also check the below link:
If you have additional questions, please submit a ticket.
Comments
0 comments
Please sign in to leave a comment.