Community discussions

MikroTik App
 
amell2020
just joined
Topic Author
Posts: 1
Joined: Mon Oct 04, 2021 5:06 pm

No audio on sip calls over VPN

Mon Oct 04, 2021 5:21 pm

Hello,
i have a FreePBX (asterisk) system as my pbx. It is connected to my Mikrotik.
PBX: 10.0.0.210
Mikrotik: 10.0.0.1/24

I have two Mikrotik i have setup server l2tp VPN and client VPN.
Server Mikrotik VPN Adr local: 10.100.0.1
Client mikrotik VPN Remote Address: 10.100.0.2

Inside my internal lan, 10.0.0.0/24, everything is working fine as voip telephony concerned.
When i connected through VPN, i can register my sip phone and i can call every number i want (internal or external). The callee is ringing normally. But i cannot hear anything, he cannot hear anything. There is no audio even in our internal calls.

I am thinking i miss something ... Are the RTP packets that are not passing through? Do i need a NAT rule? I tried to add firewall rule of accepting input chain the tcp 5060,5061 and the udp of my RTP port range but no success ...
 
mixig
Member
Member
Posts: 315
Joined: Thu Oct 27, 2011 2:19 pm

Re: No audio on sip calls over VPN

Tue Oct 05, 2021 2:55 am

I assume that maybe some routes are missing in VPN.
If you are using VPN than no NAT is needed if everything is configured properly.
Wireshark dump will tell you more...
 
User avatar
inteq
Member
Member
Posts: 410
Joined: Wed Feb 25, 2015 8:15 pm
Location: Romania

Re: No audio on sip calls over VPN

Tue Oct 05, 2021 6:09 am

In IP/Firewall/Raw add a rule with source as your VPN pool and destination as your PBX IP in prerouting chain and with action no track.
Copy the rule and reverse source with destination.
 
HandyDutchGuy
newbie
Posts: 28
Joined: Thu Nov 04, 2021 12:59 am

Re: No audio on sip calls over VPN

Thu Nov 18, 2021 5:04 am

(admins - how can I delete an empty post?)
Last edited by HandyDutchGuy on Thu Nov 18, 2021 5:08 am, edited 1 time in total.
 
HandyDutchGuy
newbie
Posts: 28
Joined: Thu Nov 04, 2021 12:59 am

Re: No audio on sip calls over VPN

Thu Nov 18, 2021 5:07 am

In IP/Firewall/Raw add a rule with source as your VPN pool and destination as your PBX IP in prerouting chain and with action no track.
Copy the rule and reverse source with destination.
@inteq - your solution worked for me. I'm not any the wiser as to why this rule works the way it does, but it solved a problem where I was connecting an IP phone over IPSEC to a phone system at a remote network, that has no working audio without the additional configuration you suggested. Thank you.
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: No audio on sip calls over VPN

Thu Nov 18, 2021 11:15 am

(admins - how can I delete an empty post?)
Next to the "edit post" button, there should be a "delete post" one - the [X] one in my skin. It asks you for a brief reasoning of the deletion in the next step. Or you press the "edit post" and there are two more options on the Options tab below the editing field:
[ ] Delete this post
[ ] Permanently delete this post so it can not be recovered

Let me know once you delete your post so I could delete this one :)
 
tomislav91
Member
Member
Posts: 303
Joined: Fri May 26, 2017 12:47 pm

Re: No audio on sip calls over VPN

Thu Nov 18, 2021 1:01 pm

Hello,
i have a FreePBX (asterisk) system as my pbx. It is connected to my Mikrotik.
PBX: 10.0.0.210
Mikrotik: 10.0.0.1/24

I have two Mikrotik i have setup server l2tp VPN and client VPN.
Server Mikrotik VPN Adr local: 10.100.0.1
Client mikrotik VPN Remote Address: 10.100.0.2

Inside my internal lan, 10.0.0.0/24, everything is working fine as voip telephony concerned.
When i connected through VPN, i can register my sip phone and i can call every number i want (internal or external). The callee is ringing normally. But i cannot hear anything, he cannot hear anything. There is no audio even in our internal calls.

I am thinking i miss something ... Are the RTP packets that are not passing through? Do i need a NAT rule? I tried to add firewall rule of accepting input chain the tcp 5060,5061 and the udp of my RTP port range but no success ...
first of all give us ping to server with and without VPN
 
biomesh
Long time Member
Long time Member
Posts: 562
Joined: Fri Feb 10, 2012 8:25 pm

Re: No audio on sip calls over VPN

Thu Nov 18, 2021 1:38 pm

Check the values for
Settings -> asterisk sip settings -> general sip settings -> nat settings -> local networks

If your network is not listed here, it will be precessed as at nat connection, even if it is not.

One of the symptoms of mis configured nat settings is no audio.
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: No audio on sip calls over VPN

Thu Nov 18, 2021 1:46 pm

I'm not any the wiser as to why this rule works the way it does
The reason is how IPsec interworks with regular routing and the firewall. If the regular routing sends a packet via some interface, and there is a src-nat or masquerade rule matching on that out-interface(-list) that changes the source address of the packet, the packet may not match to the traffic selector of the IPsec policy any more (in your particular case) or, reverse, it may start matching a traffic selector it otherwise wouldn't (in cases where the router acts as an IPsec initiator that requests IP address from the responder using the mode-config method).

Using the rule proposed by @inteq is one way to prevent the inter-site traffic from getting src-nated, as NAT is one of many functions of connection tracking, and the action=notrack rule in raw excludes the packet from being handled by the connection tracking module.

Other ways how to resolve your issue are also available, an action=accept rule shadowing the src-nat/masquerade one in /ip firewall nat, a route via another interface on which the src-nat/masquerade rule doesn't match). It all depends on your overall needs - action=notrack in raw also prevents stateful firewall from working for the matching traffic, but the other side of this is that excluding packets from connection tracking reduces the amount of CPU spend on their processing.

Who is online

Users browsing this forum: Amazon [Bot] and 143 guests