[asterisk-dev] Virtual IP Adresses and SIP requests failing...

King Ho kingho at completesolution.com.hk
Wed Jul 4 15:34:56 CDT 2007


Hi,

After some googling, I found that you can use setsockopt and IP_PKTINFO to
get the destination address and set the source address. I found a web page
with a complete example for a recvfromto() which will provide the
destination address in addition to the regular stuff that recvfrom()
provides.

Best Regards,

King

> -----Original Message-----
> From: asterisk-dev-bounces at lists.digium.com
> [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of King Ho
> Sent: Thursday, July 05, 2007 2:28 AM
> To: 'Asterisk Developers Mailing List'
> Subject: Re: [asterisk-dev] Virtual IP Adresses and SIP requests
failing...
> 
> Hi,
> 
> Sorry about responding to this after such a long time has past from the
last
> post but I have just recently encountered the same problem with having
> multiple IP address assigned to a single interface and have problem with
sip
> client registering to asterisk if asterisk uses bind=0.0.0.0.
> 
> I think what Tilghman said is not exactly correct. That is, asterisk will
> not be able to control how the packet is routed BUT asterisk DOES have
> control of which IP address the response uses for the "source ip address"
of
> the packet. That is, if I send a sip register request to asterisk at
address
> x.x.x.x, I expect asterisk to response using the same x.x.x.x address as
the
> source ip address in the response, even though asterisk won't be able to
> control how the packet is routed.
> 
> If program don't have control over which IP address to use in the source
> address in the response, then I think a lot of programs like Bind, the DNS
> server, will fail when they are bound to multiple ip addresses.
> 
> I do think that this is a bug in the handling of the response packet's
> source ip address.
> 
> Best Regards,
> 
> King
> 
> > -----Original Message-----
> > From: asterisk-dev-bounces at lists.digium.com
> > [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Tilghman
> Lesher
> > Sent: Monday, May 07, 2007 1:53 AM
> > To: Asterisk Developers Mailing List
> > Subject: Re: [asterisk-dev] Re: Virtual IP Adresses and SIP requests
> failing...
> >
> > On Sunday 06 May 2007, Christopher Aloi wrote:
> > > On 5/5/07,  Tilghman Lesher <tilghman at mail.jeffandtilghman.com> wrote:
> > > >  On Saturday 05 May 2007, Sergey Okhapkin wrote:
> > > > > Yes, it's the expected IP stack behavior when the service is bound
> to
> > > > > 0.0.0.0. Asterisk sends the repy to the address from which the
> > > > > request came, it has no control which src address to use.
> > > >
> > > > Actually, it does control it; it uses the Linux routing map to
select
> > > > which address it uses as its source address.  There has been a
request
> > > > for some time to allow Asterisk to reply on the same address on
which
> > > > it received packets, but I don't know that there's been any
successful
> > > > patch so far.  You're certainly welcome to add your efforts to
getting
> > > > Asterisk to do that, though.
> > >
> > > So what your saying is that my ultimate goal (2 ip's on different
> > > networks) is obtainable; but that I should be looking into my route
> table
> > > and not Asterisk, am I following correctly?
> >
> > Specifically, you should be using two separate network interfaces, one
for
> > each network.  Multi-homed is supported today.  Multiple addresses per
> > interface is not.  Only the primary address on each interface is used,
and
> > we use the routing table to determine on which interface to send a
packet.
> >
> > >  I wasn't able to find a bug report indicating this behavior, do you
> > > think this is something I should open for review?
> >
> > It's not a bug; it is simply a feature we haven't fully implemented yet.
> The
> > problem is that this is not easy to accomplish, and it seems that every
> > platform does it differently.
> >
> > --
> > Tilghman
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > asterisk-dev mailing list
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-dev
> 
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list