OpenVPN + OpenWRT

Hi,

I have a remote Cisco SPA112 connected via OpenVPN to my Office. I can ping both lan’s from each other without any problem. The OpenVPN tunnel endpoint’s are 10.0.7.1 (Offfice) and 10.0.7.2 (Remote). The remote router is a OpenWRT (GL AR150) and the Office router is a Pfsense. I have other applications that send traffic over the VPN without any problem.

From remote SPA112 I can call out, but the phone don’t ring, I can hear the other person but the other person can’t hear me.

The SPA112 extensions can register, with this log:

Endpoint: 221/221 Not in use 0 of inf
InAuth: 221-auth/221
Aor: 221 1
Contact: 221/sip:[email protected]:5060 Avail 57.542

Endpoint: 222/222 Not in use 0 of inf
InAuth: 222-auth/222
Aor: 222 1
Contact: 222/sip:[email protected]:5061 Avail

I don’t understand why the ip in contact is 10.0.7.2 (remote openvpn endpoint) and not the SPA112 ip (192.168.30.40).
The lan 192.168.30.0/24 is in Local Networks at Asterisk Sip Settings.

Any help please?

Thanks in Advance.

Jorge Mota

It sounds like openvpn is using NAT to connect the two network instead of routing between them. If you are using a truly routed openvpn connection, ip addresses will get re-written as you noted and most applications will work fine that way, but SIP can easily get confused. Check this link and see if this is something you can use to update your openvpn configuration to true routed mode:
https://community.openvpn.net/openvpn/wiki/RoutedLans

Thanks for your help.
I have configured the routes between the two lan’s in both sides.
I don’t understand why Freepbx recognises the SPA112 as the endpoint (10.0.7.2) and not as 192.168.30.40. I think that’s the problem!
I tried to change the Nat settings in Freepbx Sip Settings from Nat: yes to Nat: no, but don’t result.

how are you configuring SPA112? Through commercial EPM, manually, or another way? If manually, did you specify a NAT address? if EPM, did you specify NAT in the template?