[Home]

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
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Our server 10.0.1.9 makes a connection via a Linux 2.4 gateway, which has a dynamic IP address (e.g. 165.165.166.167) to a remote asterisk server (196.34.166.66).  The Linux 2.4 gateway identifies the connection by the following information:
  Source: 10.0.1.9:4569
  Destination: 196.34.166.66:4569
When the connection is initially made, the address 165.165.166.167 is assigned in the connection tracking table (/proc/net/ip_conntrack).

After a few hours, the external IP address changes, to (say) 165.146.41.42.  The above source and destination information does not change, and as a result, the old IP address (165.165.166.167) 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.

****** ADDITIONAL INFORMATION ******

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.