[Asterisk-Users] Asterisk chooses invalid outgoing interface
(IAX2, virtual interfaces)
Peter Svensson
psvasterisk at psv.nu
Thu Jan 27 05:43:33 MST 2005
On Thu, 27 Jan 2005, Rich Adamson wrote:
> > 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.
>
> 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.
I think the complaint is that asterisk does not use the destination
address for the incoming request packet as the source address for the
outgoing packet holding the reply. This will prevent the requestor from
matching the quadtuple (src addr, dst addr, src port, dst port) which
is usually used to identify a conversation. Tcp handles this transparently
but for udp it is the responsibility of the application.
Peter
More information about the asterisk-users
mailing list