Skip to main content
Topic: OpenVPN CentOS 7 Setup Private VPN :) (Read 345 times) previous topic - next topic

OpenVPN CentOS 7 Setup Private VPN :)


Introduction OpenVPN is a full-featured SSL VPN (virtual private network). It implements OSI layer 2 or 3 secure network extension using the SSL/TLS protocol. It is an open source software and distributed under the GNU GPL. A VPN allows you to connect securely to an insecure public network such as wifi network at the airport or hotel. VPN is also required to access your corporate or enterprise or home server resources. You can bypass the geo-blocked site and increase your privacy or safety online. This tutorial provides step-by-step instructions for configuring an OpenVPN server on CentOS Linux 7 server.

Procedure: CentOS 7 Set Up OpenVPN Server In 5 Minutes
The steps are as follows:

Step 1 – Update your system
Run the yum command:
{dedi@centos7:~ }$ sudo yum update

Step 2 – Find and note down your IP address
Use the ip command as follows:
{dedi@centos7:~ }$ ip a
{dedi@centos7:~ }$ ip a show eth0

Step 3 – Download and run centos7-vpn.sh script
I am going to use the wget command:
{dedi@centos7:~ }$ wget https://raw.githubusercontent.com/Angristan/openvpn-install/master/openvpn-install.sh -O centos7-vpn.sh

Setup permissions using the chmod command
{dedi@centos7:~ }$ chmod +x centos7-vpn.sh

One can view the script using a text editor such as vim/vi :
{dedi@centos7:~ }$ vi centos7-vpn.sh

RUN CENTOS7-VPN.SH TO INSTALL OPENVPN SERVER
Now all you have to do is:
{dedi@centos7:~ }$ sudo ./centos7-vpn.sh



VPN client config
At the end of the installation, you need to provide a client name. We can choose client names such as desktop for desktop VPN client or ios for Apple iPhone and so on. We can also encrypt the private key with a password for added security. So every time you start a VPN session, you need to provide a password for added security reasons:


HOW DO I START/STOP/RESTART OPENVPN SERVER ON CENTOS 7 ?
{dedi@centos7:~ }$ sudo systemctl stop openvpn@server #<--- stop server
{dedi@centos7:~ }$ sudo systemctl start openvpn@server #<--- start server
{dedi@centos7:~ }$ sudo systemctl restart openvpn@server #<--- restart server
{dedi@centos7:~ }$ sudo systemctl status openvpn@server #<--- get server status

Next, provide this file to your OpenVPN client to connect:

Apple app store: Apple iOS client
Google play store: Android client
Apple MacOS (OS X) client
Windows 8/10 client

If you need a powerful VPS to create your Private VPN , you can always order at my website https://dedi.al (Optional)

Thanks everyone and if you have any question just let me know down in the comments below.