How to set up own VPN server in 10 minutes on Kali Linux using OpenVPN

VPN is stands for Virtual Private Network. It extends a private network across a public network, and enables users to send and and receive data across shared or public networks as if their device were directly connected to the private network. Previously we have discussed about VPN and other things in this detailed post. We will got many free or paid VPN on internet but in this tutorial we will learn how we can create our own VPN server in our Kali Linux operating system.

Make own VPN server in Kali Linux


To create our own VPN server we use OpenVPN software. OpenVPN is a free and open source software that implements virtual private network. This is also very secured. Now we configure our VPN server.


First of all we need to download the installation file for OpenVPN software, to do this we open our terminal in Kali Linux and enter the following command:

wget https://git.io/vpn -O openvpn-install.sh
Then it will start download as following screenshot :

installing OpenVPN installation tool

This bash script will download and install OpenVPN for us. First we need to to give permission to run using this command:

chmod +x openvpn-install.sh


we just need to run this script using following command:

./openvpn-install.sh

Now this script will ask our public IP and it will automatically collect our public IP address.

openvopn installer kali linux

Then we need to choose a connection type for OpenVPN. Here UDP protocol is recommended so we choose 1.

openvpn for kali linux

Now we need to select the port where we want to set listening of OpenVPN. Here the default port is 1194, and we are going with default. The screenshot is following:

vpn server for kali linux

Then we need to choose DNS we want to use with VPN. Here we got some options:

  • Current system resolver
  • 1.1.1.1 (Cloudflare)
  • Google
  • OpenDNS
  • Verisign
Here we use Google's DNS so we type 3 and press enter.

VPN server in Linux

Finally, we need to type a name for the client certificate, here we can choose any client name:

How to set up own VPN server on Kali Linux using OpenVPN

Now we have set everything to run OpenVPN server. Now we need to press any key to configure our OpenVPN server. Configuring OpenVPN server in Our Kali Linux system will take some time depending our system's speed. After process complete we got our OpenVPN client configuration file as shown in following screenshot:

OpenVPN config file

Now using this kali.ovpn config file we can connect with our VPN server, from any other device, but here we must run OpenVPN server in our Kali Linux machine. To check the OpenVPN server status we run following command in our Kali Linux terminal:

service openvpn-server@server status

After running the command we can see the screenshot of OpenVPN server in the following screenshot:

openvpn server running in kali linux

We can see the server is running.

This server will automatically starts when the system boot up. To turn it off manually we can enter following command:

service openvpn-server@server stop

To start it manually we can use this following command:

service openvpn-server@server start

Let's see how we can connect our VPN over internet means when we are out of our local network. To do this we need port forwarding and a ststic IP. First of all we fix our local IP from the wifi settings IPV4 tab.

fixing local ip

Now we need to forward our 1194 port (Default port for OpenVPN) in UDP, from our router's settings. Then we need a static public IP. Usually we get dynamic IP from our internet service provider. We can ask them to provide to provide us a static IP or we can use some tool like noip.

Then we can connect any device with our VPN server from anywhere.

For this we need the OpenVPN file in connecting device. OpenVPN client is available for almost every major operating system for free. We can run the ovpn file using OpenVPN software in Windows, Mac, Linux, Android, iOS etc.

That is how we can set our own VPN server in Kali Linux and connect with them from anywhere.

Please don't forgot to share the posts on social media and for any queries or suggestions freely ask anything in the comment section.
How to set up own VPN server in 10 minutes on Kali Linux using OpenVPN How to set up own VPN server in 10 minutes on Kali Linux using OpenVPN Reviewed by Kali Linux on December 03, 2019 Rating: 5

No comments:

Powered by Blogger.