Step-By-Step Installation and Setup
Step 1: Install the OpenVPN and required packages
The first step is to install the OpenVPN. Open the terminal and type the below command :
sudo apt install openvpn
Once it gets installed using the commands below to install the OpenVPN packages using the apt command
sudo apt install network-manager-openvpn-gnome
Press Y/y and enter when being asked to install the packages. During the installation, a message box will get prompted asking for permission to restart services during the package upgrades, Type Yes to complete the installation.
Now we just need to restart the system for the changes made by installing the new OpenVPN packages to take effect.
Step 2: Download the VPN provider’s OpenVPN configuration file
For the demonstration purpose, we are using the ProtonVPN service so to download the required OpenVPN configuration files first click on the URL below and register or log in to start using its service.
https://account.protonvpn.com/login
Once you enter the into the account, select the Downloads option and then select the OpenVPN configuration files option, now choose GNU/Linux as the platform and leave the Protocol and Free server configs as the default. Now choose any of the servers listed below and click on download to save the (.ovpn) file to the system.
Step 3: Configuring an OpenVPN
First, click on the Network Manager icon at the top right of the kali desktop screen. Select VPN Connections > Add a VPN connection. The Network Manager tab is shown below.
Now select the type of VPN we wish to use for the new connection. From the drop-down menu, select Import a saved VPN configuration option and then click on Create.
Now navigate to the location where we saved our provider’s OpenVPN configuration files and select the .ovpn file of the server to which we want to connect and then click on the option Open.
Now the editing VPN window will appear for the username and the password for authentication. Click on the URL below :
https://account.protonvpn.com/account
Choose the OpenVPN / IKEv2 username option from the panel on the left side of the page.
Copy the OpenVPN / IKEv2 username and password and paste it into the editing VPN window and click on Save.
Now we will be prompted with a dialogue box to create a keyring password. If we’ve created the keyring password before, we won’t see this prompt. Type and confirm your keyring password, and then click Continue. The OpenVPN connection is now configured.
Step 4: Enabling the VPN connection
To enable the new VPN connection, click on the Network Manager icon at the top right of the kali desktop and select VPN Connections and then click on the VPN you want to use.
Once the connection is established, a notification will appear stating that we’re now connected to the VPN successfully. Now to confirm that the connection is successfully established turn off the VPN connection for a while and check for your public IP address using your browser as shown in the screenshot below.
As you can see from the screenshot, my public IP address is 49.37.70.191. Now enable the VPN connection again and refresh the page.
As you can see from the screenshot above, my public IP address has been changed to 37.19.200.2.
We now have an OpenVPN connection to our VPN provider over Linux. We can add as many connections as we want by repeating the process. When we want to connect, we just need to select the server we want to connect to and turn it on from the Network Manager.
Virtual Private Network (VPN) Setup in Kali Linux
VPN (Virtual private network) is a technology that encrypts your internet traffic on unsecured networks to protect your online identity, hide your IP address, and shield your online data from third parties. VPNs use real-time encryption and send your internet data through a secure virtual tunnel to minimize the possibility of anyone tracking what you do online. A Virtual Private Network is a way to extend a private network using a public network such as the internet.