F
F
faegar2016-05-17 12:32:44
SIP
faegar, 2016-05-17 12:32:44

How not to change src port when running src-nat or masquerade on Mikrotik?

Telephony set up.
Asterisk (LAN) -> Mikrotik -> (WAN) -> Server
SIP messages normally reach both the server and the asterisk.
Through SDP, the asterisk and the server indicate ports for media, for example, the asterisk indicates 11096 as the src port, the server - 55078.
The server sends RTP first and they normally come to the asterisk, but when the asterisk sends RTP to the server, the router changes the src-port from 11096 to 1024, accordingly, the server does not accept these RTPs, because the port is not the same.
NAT configured with masquerade

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladimir, 2016-05-17
@rostel

A normal softswitch is always ready for RTP to come from another field for clients behind NAT
If yours cannot do this, try using STUN
for asterisk 11 and higher
sip.conf [general]
rtp.conf
stunaddr=sip.stun.tld

A
Aleksandr, 2016-05-17
@cyberspy

try dst-nat... I've been struggling with it myself...

J
jidckii, 2016-05-17
@jidckii

This is how NAPT works https://ru.wikipedia.org/wiki/NAT
I don't think it's trivial to manually assign mapping when NAT is overloaded.
It seems to me that in your case it is easier to set up a VPN tunnel from Server to Mikrotik.

F
faegar, 2016-05-17
@faegar

Suddenly, adding a rule with action=netmap to dst-nat helped

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question