You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very simple steps to create your own VPN Server and use it with Multiple Clients.
This tutorial works great on CentOS 7.x, if it somehow didn't work on CentOS 8.x ( i didn't test it on CentOS 8 ) ( or above if you are coming from the future :) ), you will have to do some workarounds.
Commands:
First installation of Needed Libraries and Programs
Using Ctrl+W search short key: look for these and uncomment them (by removing ; semicolon)
#uncomment bellow
topology subnet
push "dhcp-option DNS 208.67.222.222" # change dns to whatever you want
push "dhcp-option DNS 208.67.222.222" # change dns to whatever you want
user nobody
group nobody
#comment this
;tls-auth ta.key 0
#optional uncomment # if you want your clients to be able to see each other, useful for offices or companies
client-to-client
Then Ctrl+X to Exit nano, Press Y to save then enter to overwrite
Now
$ cd /usr/share/easy-rsa/
$ ls
check which version exists, for this tutorial, easy-rsa version is 3.0.6 if it is changed (updated, got higher version, you can use the higher version)
$ cd 3.0.6
$ ./easyrsa init-pki
$ ./easyrsa build-ca nopass
// Leave blank, press enter
$ ./easyrsa gen-req server nopass
// Leave blank, press enter
$ ./easyrsa gen-req client nopass
// Leave blank, press enter
$ ./easyrsa sign-req server server nopass
yes
$ ./easyrsa sign-req client client nopass
yes
$ ./easyrsa gen-dh
Then you wait for awhile, depends on the Computer Hardware Specs
$ cd pki
$ pwd
copy the path to use it afterwards: /usr/share/easy-rsa/3.0.6/pki
$ nano /etc/openvpn/server.conf
Using Ctrl+W search short key: look for these and change them:
$ cd Setup-VPN-Server-OpenVPN-Server-in-Linux-CentOS-master
$ nano OpenVPNClientsKeysGenerator.sh
Modify 'server_static_ip_address' variable to work with your Server's IP Address
If easy-rsa version is changed?, make sure you change it in 'path_to_rsa' variable
To authorise the file to be executed
$ sed -i -e 's/\r$//' OpenVPNClientsKeysGenerator.sh
$ sudo chmod +x OpenVPNClientsKeysGenerator.sh
Then you can run it with
$ ./OpenVPNClientsKeysGenerator.sh
Follow the instructions in the Script
It will only ask for the client username, make sure it is unique
a folder has been created with the client username you wrote in the path: /root/Documents/, provides THE_CLIENT_USERNAME.ovpn and the needed keys and certs to be used for VPN Client Programs, if you want to use OpenVPN Client (Which is recommended), for Windows download it from here: