Asterisk behind NAT, Clients Connect VIA VPN + NAT

Have been reading a lot about Asterisk and in forums before thought to post a problem too on this :slight_smile:

Asterisk Server setup is little complicated. Hope, below mentioned describes the best.

Endpoints first connect to a VPN Server with IP ranges from (, that VPN Server makes a NAT to connect to our internal servers like (ranges from Here whenever endpoint tries to connect to asterisk server (, the communication flows via VPN Server (, that means whenever i check connection made to Asterisk server ( all clients connect with same IP (of VPN Server - but, with different port.) like ==> ==>

Endpoints get connected to Asterisk server (without a problem). but the call doesn’t happen/flow nor even the ring.pjsip logger.txt (12.6 KB)

I have also attached pjsip logger. Hope, it is described well.

The traffic into Asterisk is coming from an IP address of “”. Asterisk is attempting to send SIP responses there, which is done if rport is requested/enabled which it is, and this appears to be failing. The endpoint retransmits its message and we retransmit our response, over and over.

Thanks jcolp!

Traffic is coming from 172.16.XX.XX to (NAT Server) ==> 192.168.15.XX (ASTERISK SERVER).
Server is trying to respond back to (which needs to go back via (NATed)). I guess it is NAT, which is creating problem. Is there a way we can ensure traffic goes back to NAT Server ( and then to

It doesn’t appear to be going through the NAT. The source IP address of the underlying packet is If going through NAT then the NAT should rewrite that to be itself.

The source IP address on that is, so yes.

This isn’t something controlled in PJSIP or in Asterisk. The IP packet itself has the wrong source. The problem is outside of Asterisk.

Thanks jcolp again!

It was different sort of issue & had to resolve making some different networking changes. AST was good.!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.