How to control source address of IAX


I have installed 2 asterisk boxes, each one at the branch offices.
There are set up vpn and IAX protocol between these both Asterisks.

Please can you tell me where can I set up ip address from which one Asterisk comunicates with another one ?

Each Asterisk box is working also as a router, so there are 3 networks cards installed in them.

My problem is, that I added another NIC to Asterisk_1 the last week. And since this time the Asterisk_1 has been sending UDP pakets of IAX protocol (port 4569) with another source IP address than doing it before the change

So it does me trouble.

Please give me some advice


this is an OS issue and not an asterisk issue. You will either need to create some route entries to control what interface certain subnets were routed over, or you would need to configure the default gateway.


thanks for you reply, but I don’t know if you understood me exactly.

Before the change I had 3 NICs in the Asterisk_1
eth0 - public to net with address XX.XX.198.250
eth1 - private
eth2 - private

At the other site (Asterisk_2) the router had (and still has) also 3 NICs
eth0 - public to net with address XX.XX.194.42
eth1 - private
eth2 - private

The IAX2 was set up with this configuration so, that Asterisk_1 comunicates with Asterisk_2 this way:

source address (SA) - dest. address(DA) —throught vpn to Asterisk_2

therefore the following answer from Asterisk_2 was
(SA) - (DA) (4569) —throught vpn to Asterisk_1
and that was correct

Now (or last week) I’ve just added another NIC to Asterisk_1 and set up IP address of this NIC (nothing more) so the configuration is like this
eth0 - public to net with address XX.XX.198.250
eth1 - private
eth2 - private
eth3 - private

But now the pakets of IAX2 protocol already before VPN entry looks like this

source address (SA) XX.XX.198.250(4569) - dest. address(DA) —throught vpn to Asterisk_2

Of course these packets reach the Asterisk_2 box without any problem. But when the Asterisk_2 want to answer, the packet then will look like
source address (SA) - dest. address(DA) XX.XX.198.250(4569) and this is the problem. This paket will not go to Asterisk_1 throught vpn.

Is it more clearly ?
I do’t think there is OS issue. The routers routes packet jaust according the DA address, and problem is that Asterisk_1 communicates from bad address (NIC) or put IP address that i don’t want, so then the reply cannot by deliver

More over, the IAX trunks in direction from Asterisk_2 to Asterisk_1 works fine ( and it woks before) because packet are all right
Asterisk_2 sends packet with SA ( - DA (192.74.254) and the following reply from Asterisk_1 is also OK
SA ( - DA (


solved my problem