Tuesday, January 30, 2024

How to connect OpenVPN 3 client in Ubuntu 22

 How to connect OpenVPN client in Ubuntu 22

In linux, Open VPN client is connected using the configuration file.

First, Install the open vpn3 client.

#apt install apt-transport-https curl
#mkdir -p /etc/apt/keyrings
#curl -sSfL https://packages.openvpn.net/packages-repo.gpg >/etc/apt/keyrings/openvpn.asc
#echo "deb [signed-by=/etc/apt/keyrings/openvpn.asc] https://packages.openvpn.net/openvpn3/debian 
            DISTRIBUTION main" >>/etc/apt/sources.list.d/openvpn3.list
Replace the DISTRIBUTION in the above command with yours. For me mine is "jammy"
#apt update
#apt install openvpn3
Now you have installed openvpn3 in your ubuntu machine.
Type openvpn3 --help you will see bunch of commands.

Second, we need to generate the configuration file from the open vpn server

Login to your openvpn Admin UI
Under User Management, select User Profiles
Click on the "New Profile" for the user which you want to connect
Generate the profile
Download the profile file

Third, connect the VPN client

# openvpn3 session-start --config {path to the above configuration file}
Enter your username (only username no need for username@IP)
Enter password
It connects, please make sure don't close this terminal. If you need you can run as a background process.