Summary:ASTERISK-07063: IAX fails behind nat and dynamic IP because the same port source is always used
Reporter:Andrew McGill (andrewm)Labels:
Date Opened:2006-05-31 08:07:13Date Closed:2006-05-31 08:43:16
Versions:Frequency of
Description:Our server makes a connection via a Linux 2.4 gateway, which has a dynamic IP address (e.g. to a remote asterisk server (  The Linux 2.4 gateway identifies the connection by the following information:
When the connection is initially made, the address is assigned in the connection tracking table (/proc/net/ip_conntrack).

After a few hours, the external IP address changes, to (say)  The above source and destination information does not change, and as a result, the old IP address ( continues to be used.  The packets go nowhere.  

The timeout for a UDP "connection" in the tracking table is something like 10 minutes -- but every time a "registration" request is sent, the old (invalid) entry is refreshed, and lasts for another 10 minutes.

The solution is:
 Asterisk/IAX needs to omit the bind() call, so that a new port is made for each call / registration request.  This will make the "connection" unique.


The workarounds I know of, are:

 Use a VPN -- this doubles the overhead of the connection.

 Connect the internet connection directly to the Asterisk box -- not always an option.

(It's actually version 1.2.0)
Comments:By: Serge Vecher (serge-v) 2006-05-31 08:43:16

andrewm: as noted in the BUG GUIDELINES, you need to check the problem in the latest stable, which is 1.2.8 as of now. Please feel free to reopen the bug if the problem persists in 1.2.8. Thank you.