Install OpenVPN on a NAT Server

In this guide we will cover how to install OpenVPN on a NAT based VPS.



Now we have a new NAT VPS, details listed below:



Product: LDN-128

Hypervisor: ldn6-uk

OS: CentOS 6 x64 Minimal



Hostname: ldnNATinstance

Main IP: 192.168.43.243

Shared IP: (see above)


IP Addresses Assigned2a06:8ec0:0000:068e:0000:0000:0000:0001


Connect to your VM and Update

Now from this we can check the external IPv4 to connect and open a SSH window.



Once SSH is open update the OS – “yum update”


yum update command


Enable TUN/TAP

To enable TUN/TAP login to the VPS management panel with your user details and then open the instance you wish to edit.


Management Screen



Once the main VPS page has loaded click “VPS Configuration” and then enable TUN/TAP and click submit, once the changes have been successfully applied you can close the prompt window.


VPS Configuration



Now TUN/TAP has been configured we restart the VM from the panel to ensure changes take effect.


TUN/TAP Config View



Press Stop/Start in the current control panel view.



Start/Stop VPS

Install OpenVPN

Login as root and run “wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh”



In our case we want openVPN to listen on 24319 as this is one of our assigned ports (24300-24320) so we use the following setup:


nat-openvpn-setup-screenshot



We then enter our external/shared IPv4.


OpenVPN IP NAT Setup


Access OpenVPN

Now the server is configured we can access it.



Then use sFTP/SSH/rsync to download the config file.


OpenVPN NAT sFTP Download example.ovpn



Once you have downloaded the config file load it into the OpenVPN client then… Connect!


Success - Connected to OpenVPN


Secure Your Server

We would advise all system administrators to secure your new server once configured.


Steps such as SSH keys, configuration of firewall and general system best practices being deployed.

发表评论

邮箱地址不会被公开。 必填项已用*标注