Quantcast
Channel: SysAdminMan »» VPN:PBX - SysAdminMan
Viewing all 11 articles
Browse latest View live

VPN:PBX – Getting Started

$
0
0

VPN:PBX is the SysAdminMan virtual PBX template that includes Asterisk, FreePBX, A2Billing and OpenVPN. More information can be found here - http://sysadminman.net/sysadminman-vpnpbx-hosting.html

It is designed to work with the TP-Link TL-WR1043ND broadband router. A custom OpenWRT firmware is provided to simplify the connection of your network to your SysAdminMan VPS, securely and without the hassle of NAT.

STEP 1 – DOWNLOAD THE CUSTOM FIRMWARE

Download the custom  TP-Link TL-WR1043ND firmware with OpenVPN client installed -

http://sysadminman.net/openwrt/tl-wr1043nd-sysadminman-v3.04.bin

STEP 2 – PLUG IN THE TP-LINK WR1043ND

  1. Plug a PC/Laptop in to the yellow port 1
  2. Plug the blue WAN port in to a spare port on your existing internet router
STEP 3 – LOG IN TO YOUR TP-LINK WR1043ND AND FLASH THE NEW FIRMWARE

* While every effort is made to test the firmware provided no responsibility can be accepted if you use the firmware above and it renders your router unusable. This is always a risk that is taken when flashing any new firmware to a device *

You must log in from a computer connected to a yellow LAN port.

Default IP address : 192.168.1.1

Default username : admin

Default password : admin

TP-Link-1043_initial_login

Select System Tools / Firmware upgrade and then choose the firmware image you downloaded above -

TP-link_firmware_upgrade

Click upgrade and the new firmware will be loaded and the router restarted. Do not disconnect the power while this is happening!! -

openwrt_upgrade_restarting

STEP 4 – RESET YOUR COMPUTER OR RENEW YOUR DHCP LEASE

You will now need to get your computer to pick up a new DHCP address from the TP-Link TL-WR1043ND. This will be in the range 10.99.99.X. This can be done by either rebooting, pulling and reinserting the network cable or running the command to renew the IP address. Please note that the WiFi is disabled on the TP-Link TL-WR1043ND firmware so you must use a cabled connection.

SETEP 5 – LOG IN TO YOU TP-LINK ROUTER AGAIN

Default IP address : 10.99.99.1

Default username : root

Default password : sysadminman

OpenWRT_login

STEP 6 – ENTER THE SYSADMINMAN VPS CONNECTION DETAILS IN TO YOUR TP-LINK ROUTER

For this step you will need the IP address of your SysAdminMan server plus the 3 files that will be sent to you separately. The 3 files are called  ca.crt, tplink.crt and tplink.key.

Click on Network / SysAdminMan and you will see the screen below. Enter your SysAdminMan VPS IP address in the box provided and upload the 3 files. Ensure you upload the correct file to the correct place. Then click Save & Apply -

SysAdminMan_OpenWRT_VPN_config

Next reboot the router. There is an option to do this under System / Reboot -

OpenWRT_reboot_router

Now if you log back in and select Network you should see that the ‘SYSADMINMAN’ interface has been assigned an IP address of 10.98.0.X -

OpenWRT_Network_details

STEP 7 – FINISHED!

And that should be everything. Now any device connected to your TP-Link should be given an IP address in the range 10.99.99.x and be able to connect to your SysAdminMan VPS server using the address 10.98.0.1 over the secure OpenVPN tunnel.

Also, any phone that is connected to your TP-Link that has auto provisioning set will be given a TFTP server address of 10.98.0.1, your SysAdminMan VPS address. This means that you can use the FreePBX EndPoint Manager module to configure your telephone handsets.

NETWORK DETAILS

  • TP-Link LAN address : 10.99.99.X
  • SysAdminMan VPS address : 10.98.0.1

 


VPN:PBX – Using FreePBX Endpoint Manager

$
0
0

VPN:PBX is a new offering from SysAdminMan combining Asterisk, FreePBX and OpenVPN. More details can be found here - http://sysadminman.net/sysadminman-vpnpbx-hosting.html

While using FreePBX Endpoint Manager is possible with a normal SysAdminMan system, using it with VPN:PBX is really simple as no firewall or router changes are required.

Endpoint Manager is a FreePBX module that allows you to configure VOIP handsets centrally – no settings are required to be entered on the handset itself – just plug it in!

Here is the way it works -

  1. The phone is switched on and given a DHCP address by the TP-Link TL-WR1043ND router
  2. It is also given the IP address of the Asterisk server as it’s TFTP server – in this case of a SysAdminMan VPN:VPS that’s 10.98.0.1
  3. The phone contacts the TFTP server (10.98.0.1) and asks for it’s configuration settings. It gives the server its MAC address to identify itself
  4. EPM manager identifies the handset based on its MAC address and configures the phone

Brilliantly simple and also makes it very easy to deploy new phones and make changes to deployed phones. Endpoint Manager supports lots of different manufacturers handsets including – Aastra, Grandstream, Polycom, Snom, Cisco and Yealink.

So, how does it work in practice? Here is a quick guide for deploying a new handset with Endpoint Manager -

First get the MAC address of the handset. In this case an Aastra 6755i -

Aastra 6755i MAC address

Next create an extension as normal in FreePBX. The only settings required are User Extension, Display Name and Secret -

Add FreePBX extension 1

Add FreePBX extension 2

Next enable the required handset template in Endpoint Manager / Endpoint Configuration -

Endpoint configuration 1

Endpoint Configuration 2

Finally add a device in Endpoint Manager End Point Device List -

Endpoint device list#

and clink on Rebuild Configs for All Phones -

EPM rebuild configs

Now when you connect your handset to the network it should connect to Endpoint Manager and download it’s configuration. Here’s mine making an echo test call -

Aastra 6755i Endpoint Manager

 

Because the TP-Link router creates a OpenVPN tunnel to the VPN:PBX server no NAT, firewall or router changes are required.

GoIP GSM Gateway and Asterisk using VPN:PBX

$
0
0

Recently I had a VPS customer that was looking to get a GoIP GSM Gateway working with his Asterisk VPS. These little SIP/GSM gateways can be used to connect Asterisk to the GSM/mobile network. The single-sim models can be had for around £100 from e-bay.

They are not the easiest boxes in the world to set up, with the web GUI being rather confusing. Eventually though the GoIP was configured correctly but still calls we intermittent, with connection to the Asterisk server being lost.

As the GoIP box was being hosted behind a residential ADSL router the issues were typical of NAT/Firewall problems. They were probably being caused by a mixture NAT and a SIP ALG (application layer gateway) in the ADSL router.

The solution was to use the new SysAdminMan VPN:PBX template which uses OpenVPN to create a secure VPN tunnel to the Asterisk server. The customer purchased a TP-Link 1043 router, flashed the SysAdminMan firmware, and the GoIP was connected to the VPS over the VPN. This meant that private IP address ranges were used, with no NAT happening at all. This is a great example of how using VPN:PBX to provide a VPN connection to your Asterisk server is easy to deploy and works around any NAT/Firewall issues.

Here is a diagram showing the customers setup -

GoIP using VPNPBX

See here for more information - http://sysadminman.net/sysadminman-vpnpbx-hosting.html

OpenVPN with Asterisk, FreePBX and A2Billing

$
0
0

We’ve released an update to the firmware for the SysAdminMan VPNPBX template. This template includes OpenVPN, Asterisk, A2Billing and FreePBX and is designed for customers that want to have a secure VPN connection to their hosted PBX (without the worries of NAT).

The firmware is based on OpenWRT and works with the popular TP-Link 1043 router. The latest firmware release works with models v1.18 and v1.19.

These are the steps to having a hosted PBX with a secure VPN connection to it -

  1. Order a SysAdminMan server specifying the VPNPBX template
  2. Purchase a TP-Link 1043ND router (from any supplier)
  3. Download the custom TP-Link 1043 firmware from the SysAdminMan site and install on the router
  4. Enter the supplied OpenVPN connection details in to the router and you’re ready to go
  • You could also use any other OpenVPN client to connect to the server if you prefer

For more details about the VPNPBX template see here – http://sysadminman.net/sysadminman-vpnpbx-hosting.html

For more information about installing the custom OpenVPN firmware see here – http://sysadminman.net/blog/2012/vpnpbx-getting-started-3890

Update to SysAdminMan VPN:PBX template

$
0
0

The SysAdminMan template that includes OpenVPN, Asterisk, FreePBX and A2Billing has been updated with the following versions -

Asterisk : 11.3.0
FreePBX : 2.11
A2Billing : 2.0.1

This VPS template has OpenVPN installed with example certificates created. It’s a great solution for setting up a secure off-site PBX. You can use any OpenVPN client to connect, or there is a custom firmware available that turns a TP-Link 1043 in to an OpenVPN gateway.

For more information see - http://sysadminman.net/sysadminman-vpnpbx-hosting.html

Using SysAdminMan OpenVPN template with pfSense

$
0
0

I’ve had a few customers recently using the SysAdminMan VPN:PBX template with an existing on-site pfSense gateway. The VPN:PBX template has Asterisk, FreePBX and A2Billing installed, along with OpenVPN setup to allow secure connections to the VPS.

pfSense can be used as an OpenVPN client/gateway so this makes a great combination for a secure off-site PBX.

Here are some setup instructions for configuring pfSense with the SysAdminMan VPN:PBX template.

1 – Obtaining the OpenVPN client certificates

When your SysAdminMan server is created 3 files will be generated that are required to configure pfSense as an OpenVPN client. These files can be e-mailed to you or retrieved from the VPS using a program like WinSCP. The 3 files are -

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

These 3 files identify an individual OpenVPN client. If you are just connecting a single gateway this is all you will need. If you’d like instructions for creating more certificates please open a support ticket.

2 – Installing the Certificates on pfSense

Next we need to install the 3 certificates above in pfSense. The 3 files (ca.crt, tplink.key and tplink.crt) are text files which we can open with notepad, or something similar, and copy and paste the contents in to the correct place in pfSense.

First select “System/Cert Manager” from the pfSense menu. Then we click to add a CA -

pfsense add CA

Call the new CA ‘sysadminman’ and paste the contents of the file ca.crt in to the ‘Certificate data’ box -

pfsense CA data

After saving that go back to Cert Manager and click on the ‘Certificates’ tab. There will probably be a default one, but we need to add a new certificate -

Add a certificate in pfsense

Call the new certificate ‘sysadminman’ and paste the contents of tplink.crt in to the ‘Certificate data’ box and the contents of tplink.key in to the ‘Private key data’ box -

pfsense add certificate for OpenVPN

If we save that we should now be able to see our new certificate configured on the Certificates page -

pfSense certificate

3 – Configuring OpenVPN in pfSense

Now we can configure OpenVPN on pfSense. Select ‘VPN/OpenVPN’ from the pfSense menus and then click on the ‘Client’ tab. Then click to add a new OpenVPN client -

pfSense add OpenVPN client

Now we need to enter our VPN connection details. Under General information the only thing you should need to change is the Server address. Here you should enter the IP address of your SysAdminMan VPS -

pfSense OpenVPN details

Under Cryptographic Settings you should ensure TLS Authentication is not selected, you select the 2 ‘sysadminman’ certificates we created and that the Encryption algorithm is set to ‘BF-CBC (128-bit)’ -

pfSense OpenVPN settings

Once that’s done pfSense should connect to our VPS. We can see the status of the connection by going to OpenVPN Client and clicking on the ‘s’ button -

pfSense OpenVPN status

4 – Telling OpenVPN about our local LAN

By default OpenVPN on the SysAdminMan VPN:PBX template assumes that your local network is using 10.99.99.0/24. If you are setting up a new site and can use this then there is nothing more to change.

If you are using an existing numbering block then we need to tell OpenVPN on the VPS what that is. So let’s assume you are using 192.168.10.X at your site. There are 2 files we need to change on the VPS. If you’d like this doing for you please open a support ticket.

The first is /etc/openvpn/server.conf where we need to change -

...
route 10.99.99.0 255.255.255.0
...

to

...
route 192.168.10.0 255.255.255.0
...

The second file to change is  /etc/openvpn/ccd/tplink where we need to change -

iroute 10.99.99.0 255.255.255.0

to

iroute 192.168.10.0 255.255.255.0

And then just restart OpenVPN with -

service openvpn restart

5 – Testing!

Now from a local PC you should be able to ping your SysAdminMan VPS over the VPN. The IP address of the server is 10.98.0.1, so we can -

ping over OpenVPN

Now when you are connecting a phone to Asterisk over SIP, or managing the server over HTTPS you can use the VPN address of 10.98.0.1 instead of the servers public IP address.

6 – Troubleshooting 

If you are having problems getting this working then check the error log at /var/log/messages for OpenVPN system messages or open a support ticket for us to take a look.

Getting started with SysAdminMan OpenVPN and FreePBX/A2Billing

$
0
0

When you rent a VPNPBX server from SysAdminMan you get a server with Asterisk/FreePBX/A2Billing and OpenVPN installed.

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 on a new SysAdminMan VPNPBX system. 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

Connecting Yealink T22P to Asterisk using OpenVPN

$
0
0

Recent firmware versions for the Yealink T22P include the ability to connect to an OpenVPN server. This encrypts the traffic between the phone and Asterisk server. It also removes any NAT/SIP issues.

This guide was written using a SysAdminMan VPNPBX VPS and a Yealink T22P with firmware 7.70.23.2.

Different Yealink models, or the T22P with different firmware may behave differently!

The SysAdminMan VPNPBX comes with a script for creating the certificates and config file required to connect a Yealink T22P to an OpenVPN server. To create a certificate log in as root and then run …

cd /usr/local/bin
./yealinkvpn.sh yealink1 my@email.com

Where yealink1 is the name of the phone you want create (you should create a new certificate for each phone) and my@email.com is your e-mail address. The config file, called openvpn.tar, will then be e-mailed to you.

Next we need to load this config file to the phone. I recommend performing a factory reset on the phone before doing this.

Log in to the GUI of the phone and select Network / Advanced -

yealink config
Now scroll down to the VPN section and chose the file to import. My screenshot here shows VPN as Enabled but you will not be able to set this until you have imported a config file. Unfortunately there’s not really any feed back to say this has worked successfully!

Import the file, then set Active to Enabled, then select Confirm at the bottom of the screen -

Yealink OpenVPN

Now restart the phone and if it connects successfully you should see “VPN” in the top right hand corner of the display. If you have any problems the error logs to check are /var/log/messages on the server or download the system logs from the phone.

Once connected via VPN you can setup your extension in FreePBX and also set the SIP account details on the phone. The SIP/Proxy address to use is 10.98.0.1, which is the VPS address when using the VPN.

Non SysAdminMan customers only

If you are not using the SysAdminMan VPNPBX then the script below may help with setting up your system. This is what is run above to create the OpenVPN config file for the phone -

#!/bin/bash
if [ "x$1" == "x" ]; then
echo;echo;echo;
echo "Usage : yealinkvpn.sh client_name your_email (eg - yealink.sh yealink1 me@mail.com)";
echo;
exit;
fi

ip=`/sbin/ifconfig venet0:0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`

cd /etc/openvpn

source ./vars
./build-key $1

echo "client
dev tun
proto udp
remote $ip 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /yealink/config/openvpn/keys/ca.crt
cert /yealink/config/openvpn/keys/$1.crt
key /yealink/config/openvpn/keys/$1.key
ns-cert-type server
verb 3" > /etc/openvpn/vpn.cnf

tar cvf openvpn.tar vpn.cnf keys/ca.crt keys/$1.crt keys/$1.key

echo "Upload the attached tar file to your phone without extracting" | /usr/bin/mutt -s "Yealink OpenVPN files for client : $1" -a /etc/openvpn/openvpn.tar $2

service openvpn restart

OpenVPN to Asterisk using a Microtik router

$
0
0
Microtik RB750GL

Microtik RB750GL

For a while now SysAdminMan has been offering FreePBX/A2Billing hosting with OpenVPN server already installed on the server. What I really want to find is the perfect client/router that’s simple to configure and easy to deploy. We’ve been recommending OpenWRT for a while now but it can be a pain to flash the firmware and get OpenVPN configured.

I’ve also used Microtik routers for a while and they are very powerful routers in such a small, reasonably priced, package. This test was done using a Microtik RB750GL

I wasn’t sure how it would work though as Microtik routers only support OpenVPN over TCP, not UDP. This means all the VOIP traffic will be running over a TCP connection which, in theory, is not ideal.

This performance testing was done using -

  • Virgin Media Broadband with 60mb down and 3mb up. The upload limit on your broadband connection will nearly always be the limiting factor for call quantity/quality
  • Asterisk is running on a SysAdminMan VPS and is placing the incoming calls to music-on-hold
  • sipp was used  at the remote site to generate test calls
  • Linksys SPA941 was used at the remote site to test call quality
  • G711/aLaw was used for all calls
  • No other traffic was happening on the broadband connection

We start off with 10 concurrent calls, then 20 and finally 40.

10 CONCURRENT CALLS

Here you see we have sipp generating 9 G711 calls with audio

sipp 9 calls

sipp 9 calls

and the traffic flowing through my Virgin Media broadband connection. Over the OpenVPN TCP link each G711 call is using around 110kb/s

9 concurrent calls

9 concurrent calls

and here is the audio from a call placed from the Linksys physical phone

 

20 CONCURRENT CALLS

Here you see we have sipp generating 19 G711 calls with audio

19 concurrent calls

19 concurrent calls

and the traffic flowing through my Virgin Media broadband connection

19 concurrent calls

19 concurrent calls

and here is the audio from a call placed from the Linksys physical phone

 

40 CONCURRENT CALLS

Here you see we have sipp generating 39 G711 calls with audio

39 concurrent calls

39 concurrent calls

The upload link on my broadband connection is being overwhelmed and sipp is starting to report call errors.

My broadband link is reporting traffic throughput wildly up and down as it struggles to limit the flow of traffic being sent to it

39 concurrent calls

39 concurrent calls

and the audio from the call on the physical phone is breaking up and would likely be unintelligible. This is the audio that is being downloaded over the broadband link, the uploaded audio is likely much worse

 

CONCLUSION

Even though I found the limits of my broadband link and ended up with a poor quality call the results of running VOIP over a TCP OpenVPN tunnel were actually much better than I thought they would be. Twenty concurrent calls ran with no problems, and I think this would be much higher using a different codec.

There are a few things to consider though -

  • Many routers will automatically prioritise UDP traffic. This is not going to be the case for OpenVPN traffic running over TCP. It’s likely that other traffic on the link (file downloads, web browsing …) would affect the audio calls. If you are going to be using the link for other traffic you will probably want to prioritise the OpenVPN traffic on the broadband router if possible
  • These tests were done a a fast, stable broadband link. I’m unsure what the results would be on a slower link, or a link with poor jitter or packet loss.

In another post I’ll detail the steps involved in getting OpenVPN set up on a Microtik router

OpenVPN with Asterisk and FreePBX

$
0
0

SysAdminMan offers OpenVPN server setup on all hosted systems. This means you can rent a FreePBX server with OpenVPN server already installed and configured. You can connect any OpenVPN client to this but one of the easiest ways to get this working is to install the SysAdminMan customer firmware for the TP-Link 1043 broadband router.

This custom firmware is already configured as an OpenVPN client – you just need to enter your FreePBX server IP address along with the security credentials.

Why run OpenVPN?

Running a VPN to your FreePBX server in the cloud provides 4 benefits –

  1. All traffic (telephone calls) between the phone and the FreePBX server are encrypted to prevent eavesdropping
  2. Removes any NAT happening between the extension and the Asterisk server
  3. Bypasses any VOIP blocking by your ISP
  4. Provides secure access to the FreePBX web interface

How it works?

OpenVPN server software sits on the hosted FreePBX system allowing secure connections to the server. Traffic is encrypted between the OpenVPN client and the SysAdminMan FreePBX system. A certificate is generated for each OpenVPN client that connects to the server.

You can connect either an extension that supports OpenVPN directly (this could be a computer running OpenVPN with a softphone installed or some of the Yealink VOIP handsets support OpeNVPN directly) or, more commonly, connect an entire site via OpenVPN using a router with OpenVPN support.

It is possible to connect multiple sites to the same SysAdminMan system as long as each site uses a different LAN IP range

What router can you use?

You should be able to use any router that supports OpenVPN. I’ve tested with pfSense, Microtik (this is not the best choice as it only supports TCP connections, not UDP) and the OpenVPN Windows client. Maybe the simplest way though it to use the SysAdminMan custom firmware with the TP-Link 1043.

Using the TP-Link 1043 SysAdminMan firmware

There are 2 different ways you could use the TP-Link 1043 with the SysAdminMan firmware installed. The easiest way is to replace the existing broadband router and have all the routing via the TP-Link. That would look something like this –

SysAdminMan OpenVPN Asterisk FreePBX

That’s not always possible though. You may not want (or be able to) replace the existing router, certainly not while testing. What you can do is plug the TP-Link 1043 in to the existing router, so that it has an internet connection and then plug the phones in to the TP-Link 1043. The phone will then connect to the FreePBX/Asterisk system over OpenVPN, with the rest of the network unaffected –

OpenVPN Asterisk/FreePBX

 

How do you get this setup?

You can sign up for a hosted FreePBX server with OpenVPN installed at SysAdminMan FreePBX Hosting

Instructions for setting up your TP-Link 1043 with OpenVPN can be found here – https://sysadminman.net/blog/2012/vpnpbx-getting-started-3890

For more information about using a SysAdminMan system with OpenVPN please get in touch

The post OpenVPN with Asterisk and FreePBX appeared first on SysAdminMan.

FreePBX with OpenVPN and End Point Manager

$
0
0

I’ve written quite a bit about using OpenVPN with a hosted FreePBX system but it can be difficult to provide an overview, so I thought I’d do a quick video to show what’s possible.

There are some great benefits to using OpenVPN to connect to a hosted FreePBX server, including –

  • bypasses any NAT issues with routers
  • bypasses any issues caused by SIP ALGs in routers
  • audio is encrypted over the internet
  • port 5060 (SIP) can be closed on the FreePBX system
  • gets round issue of allowing dynamic IPs in the FreePBX firewall

Check out the video for an overview of how things can be set up …

For more information about using OpenVPN with FreePBX please see here – https://sysadminman.net/blog/2015/openvpn-with-asterisk-and-freepbx-6758

SysAminMan custom router firmware can be downloaded here – https://sysadminman.net/blog/firmware

The post FreePBX with OpenVPN and End Point Manager appeared first on SysAdminMan.

Viewing all 11 articles
Browse latest View live