[OpenSIPS-Users] Load balancer probing from incorrect interface

Bill W. opensips at aastral.net
Wed Dec 1 22:05:58 CET 2010


Hey Bogdan,

Thanks so much for your help.  For the benefit of the group, I
eventually came up with a work-around for this.

I use the following in opensips.cfg
listen=udp:probe-internal:5090
listen=udp:probe-external:5090

Then in the hosts file on machine A I put:
10.0.10.1 probe-internal
66.180.205.11 probe-external

And on machine B I put:
10.0.10.2 probe-internal
66.180.205.12 probe-external

So when opensips fails over from A to B, it picks up the new probing-IP
from the hosts file. Then the probes from the default IP as selected by
the kernel routing table work correctly, as they are coming from a port
other than 5060.

Hope this helps,
Bill

On 11/24/10 6:10 AM, Bogdan-Andrei Iancu wrote:
> Bill W. wrote:
>> Hello Bogdan,
>>
>> Okay I've been researching this more.  I am not a programmer, but it
>> looks like get_out_socket and find_si in forward.c and socket_info.c are
>> just comparing ip addresses, and when opensips is trying to probe an
>> interface on the same machine, but is not bound to that IP, then source
>> IP address selection fails.
>>
>> The challenge is that my instance of opensips is an HA service between
>> two machines, so I cannot simply specify IPs to listen on in
>> opensips.cfg because the source IPs I need to probe from will change
>> depending on which machine opensips is running on.
>>   
> That is not possible - you cannot change at runtime the interfaces
> opensips works with - you cannot make it to listen on a newly added
> interface, you cannot make it stop using an already configured interface.
> 
> Each time you change the interfaces on the server, if you need to
> restart opensips.
> 
>> It looks like the solution to make this work with the existing
>> get_out_socket code is to be able to specify interface aliases in the
>> listen= directive.
>>
>> If I could do something like this:
>> listen=udp:eth0:5090        # for probing eth0 IP alias
>> listen=udp:eth0.0:5090        # for probing eth0:0 IP alias
>> listen=udp:eth1.1:5090        # for probing eth1:1 IP alias
>>
>> Then opensips could pick the appropriate IP from the interface/alias on
>> the machine where it is running.
>>
>> If that's too complex, then the brute-force method would be to allow
>> this:
>> listen=udp:*:5090        # for probing
>>   
> 
> to be honest, never tried something like that - let me know if it works
> for you
> 
> Regards,
> Bogdan
>> I can't simply use the port= directive because I've got other services
>> running on 5060.
>>
>> Thoughts? Thanks!
>> Bill
>>
>>
>>
>> On 11/12/10 8:27 PM, Bill W wrote:
>>  
>>> Hi Bogdan,
>>>
>>> Thanks so much for explaining how interface selection works.
>>>
>>> Unfortunately the other interfaces all have daemons listening on port
>>> 5060 and are in production and I can't simply reallocate IPs.
>>>
>>> So for the error messages below, is the problem that opensips is trying
>>> to send out a packet on the automatically selected IP but since port
>>> 5060 is occupied on that address, the socket is failing?
>>>
>>> If so, is it possible to specify a different source port so the packet
>>> will go out?
>>>
>>>
>>> Thanks,
>>> Bill
>>>     
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>   
> 
> 



More information about the Users mailing list