[Asterisk-Users] Asterisk chooses invalid outgoing interface (IAX2, virtual interfaces)

Rich Adamson radamson at routers.com
Thu Jan 27 05:14:48 MST 2005


> i have an asterisk box with two external ip addresses (say 1.2.3.4 on 
> eth0 and 1.2.3.5 on eth0:1) and one "internal" vpn ip address (say 
> 10.0.0.1 on tun0)
> 
> The problem is:
> when a client conntects via iax to 1.2.3.4, the asterisk server responds 
> on 1.2.3.5 and the packets are not accepted by the client.
> I can kinda fix this by using the bindaddr option, but then i can't 
> accept calls on tun0.
> IMHO the asterisk responses should always be sent from the ip the 
> request was received on.
> 
> Any ideas on how to fix this?

Its a misunderstanding of how packets are handled on your system.

Packets are _not_ sent on an interface just because it arrived on
that interface. The packets are sent based on your routing table
(netstat -rn) entries. If your system does not specifically know
how to reach the destination, the packet is sent on the default
route.

Try adding route statements to your system to define each network
accessible via each interface, and ensure a single default route
points to your catch-all (eg, Internet) interface.





More information about the asterisk-users mailing list