[asterisk-users] chan_sip sending from wrong source address when multiple interfaces are used

Raj Mathur ( राज माथुर ) raju at linux-delhi.org
Thu Jul 12 22:03:03 CDT 2012


On Thursday 12 Jul 2012, Kevin P. Fleming wrote:
> On 07/11/2012 11:36 PM, Jeff LaCoursiere wrote:
> > This does exhibit the problem though.  Your OS stack assumes one of
> > those addresses - the first identified interface? - is the one that
> > all replies will appear to come from.  So phones on the
> > 192.168.2.0/24 network that try to register get replies from
> > 192.168.1.1 and ignore them.
> 
> No, I don't think it does. If the server has four interfaces, on
> subnets 192.168.{1,2,3,4}.0/24, those are *not* overlapping, and
> everything will work as expected. If a UDP packet is received on the
> third interface, from an address reachable via routes over that
> interface, then the reply to that packet will be sent out over that
> same interface, with the source address set to the address assigned
> to that interface. Servers are setup this way all the time, and it
> works as it should.

Precisely.  In fact, if a packet from 192.168.2.n is received on /any/ 
interface, the response will always go out from the 192.168.2.X 
interface.  (Barring some weird routing/iptables configuration, of 
course.)

> There must be more to the network configuration than something this
> simple in order to cause the IP stack on the Asterisk server to
> choose the wrong source IP address for outbound packets.

I've usually seen this (wrong interface chosen for outbound) happen when 
NAT is in the picture.  However, the OP doesn't mention any NAT-related 
configuration.

Regards,

-- Raj
-- 
Raj Mathur                          || raju at kandalaya.org   || GPG:
http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
It is the mind that moves           || http://schizoid.in   || D17F



More information about the asterisk-users mailing list