How easily install OpenVPN on NAT VPS?

This will help you how easily install OpenVPN on NAT VPS. Firstable, please take a note which opened ports applicable for your VM. You may ask to support or check VM details for which ports opened.

Login to server as root and install it.

wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh

This will automatically install the vpn. This will need root privilege or sudo user privilege.

Welcome to this OpenVPN road warrior installer!

This server is behind NAT. What is the public IPv4 address or hostname?
Public IPv4 address / hostname [x.x.x.x]:

Hit Enter.

Which protocol should OpenVPN use?
1) UDP (recommended)
2) TCP
Protocol [1]:

Choose 1.

What port should OpenVPN listen to?
Port [1194]:

In this part, we need to fill the ports given. You will get free 25 ports opened both TCP and UDP. You can ask support, or check service VPS details which ports can be used for your VM.

Select a DNS server for the clients:
   1) Current system resolvers
   2) Google
   3) 1.1.1.1
   4) OpenDNS
   5) Quad9
   6) AdGuard
DNS server [1]:

We can choose 1.

Enter a name for the first client:
Name [client]:

Name your openvpn client name. Feel free to name it.

OpenVPN installation is ready to begin.
Press any key to continue...

Now press any key to continue to start openvpn server installation. This may take few seconds to be completed.

Once completed, the configuration saved under /root/your-client-name.ovpn

You may retrieve the config file and import into Openvpn configuration. I tried this installation under Centos 7, however it should be no problem under Ubuntu or Redhat.

Leave a Reply 0

Your email address will not be published. Required fields are marked *