Summary:ASTERISK-17062: IAX2 bindaddr doesn't bind to IP address
Reporter:Eugene Blanchard (blanchae)Labels:
Date Opened:2010-12-03 10:35:38.000-0600Date Closed:2012-03-08 13:15:00.000-0600
Versions:Frequency of
Description:When using the bindaddr directive in iax_general_custom.conf, (included in iax.conf), IAX2 does not bind to the IP address.

chan_iax2.c: Ignoring bindaddr

This bug was originally noted on
* FreePBX : 2.5.1
* Asterisk Source Version :  (later tested on
* Dahdi Source Version :
* Libpri Source Version : 1.4.9
* Addons Source Version :

With IAX2 and the iax_general_custom.conf file. bindaddr=xxx.xxx.xxx.xxx
is ignored on reload. It defaults back to address which is any interface.


The purpose of the bindaddr="IP address of interface" is to direct IAX2 to
only use a specific interface for communication. This is ABSOLUTELY
necessary if you are using VLANs on your Asterisk PBX.

Example: if you have an IAX softphone (PC) on the Data VLAN and attempt to
register to PiaF using its Voice VLAN interface (which you should for
QoS), PiaF responds with its Data VLAN interface. The softphone chokes on
the reply because it received the wrong IP address. It was expecting a
Voice VLAN IP address. This would also affect any IAX2 trunks coming in from
other VLANs. Causes a routing mess..

Also if you are using iptables for traffic shaping and have eth0 as the voice interface (with bindaddr point to its IP address) and eth1 as the data, then the voice traffic can go to eth1 and be dropped.

This is a follow-up to bug https://issues.asterisk.org/view.php?id=16561

Is there a work around in updating iax2 only?
Comments:By: Eugene Blanchard (blanchae) 2010-12-03 10:38:06.000-0600

I would love to test a newer version of chan_iax2.c but there is little documentation on it and less on updating it only.

By: Sean Bright (seanbright) 2011-01-29 16:50:29.000-0600

I'm sorry, I'm a bit unclear on this one.  It appears that bindaddr is only ignored on reload, not when asterisk starts.  Are you saying that bindaddr is also ignored on asterisk startup?

By: Eugene Blanchard (blanchae) 2011-01-30 02:16:22.000-0600

bindaddr = for IAX is ignored in my testing on reload or when asterisk starts. Doesn't work with the versions that I've tried. Basically, I have two ethernet cards: eth0 and eth1. using bindaddr to point to eth0's IP address doesn't work. IAX goes out eth1's port. Wiresharking shows requests coming in on eth0 and IAX going out on eth1 regardless of bindaddr settings. FYI eth0 is on a different subnet then eth1.

The result is if an IAX phone is registering to eth0, IAX may respond from eth1 which has the wrong subnet address. The IAX phone ignores the response because it is expecting the registrar on eth0 to respond.

By: Sean Bright (seanbright) 2012-02-20 12:33:07.375-0600

This appears to work for me in the latest 1.8 release.  I'm able to bind to a specific IP with {{bindaddr}}.  Are you still seeing this problem?

By: Eugene Blanchard (blanchae) 2012-03-08 13:14:23.211-0600

I just checked using and it works. This bug can be closed.

By: Eugene Blanchard (blanchae) 2012-03-08 13:15:00.052-0600

Fixed in 1.8