Getting started with OpenVPN and FreePBX/A2Billing

OpenVPN is a VPN system that works on many different clients. This guide will go through getting started with the Windows client, others will be very similar.

The first thing you need to do is install the Windows OpenVPN client. This can be downloaded at – http://openvpn.net/index.php/access-server/download-openvpn-as-sw/357.html

Once installed we need to get the certificates for our OpenVPN connection. By default 3 files are created. These are –

/etc/openvpn/keys/ca.crt
/etc/openvpn/keys/tplink.crt
/etc/openvpn/keys/tplink.key

(The fact that they are called tplink is unimportant. They will work with any OpenVPN client)

We want to copy these files to our OpenVPN config folder. We are going to use WinSCP for this. We need to start WinSCP as an Administrator so that it can write to the OpenVPN config folder –

run winscp

Next log in to your VPS using the root password provided –

winscp login

Now copy the 3 files above from “/etc/openvpn/keys” to “c:\program files\OpenVPN\config” –

openvpn certificate copy

Finally you need to edit the file “c:\program files\OpenVPN\config\client.ovpn”. I recommend using something like Notepad++ to retain the formatting. The file should contain the following settings –

client
dev tun
proto udp
remote VPS-IP-ADDRESS

resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert tplink.crt
key tplink.key
ns-cert-type server
verb 3

You should change the ‘remote’ line to be the IP address of your VPS.

If all that worked OK we should now be able to connect to our VPS using OpenVPN –

openvpn connect

and ping the IP of our VPS over the VPN –

ping 10.98.0.1

Pinging 10.98.0.1 with 32 bytes of data:
Reply from 10.98.0.1: bytes=32 time=21ms TTL=64
Reply from 10.98.0.1: bytes=32 time=21ms TTL=64
Reply from 10.98.0.1: bytes=32 time=21ms TTL=64
Reply from 10.98.0.1: bytes=32 time=19ms TTL=64

Ping statistics for 10.98.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 19ms, Maximum = 21ms, Average = 20ms