[SR-Users] Outbound socket selection (HA implementation)

marius zbihlei marius.zbihlei at 1and1.ro
Tue Mar 29 16:14:40 CEST 2011


On 03/29/2011 03:32 PM, Asgaroth wrote:
> Hi Marius,
>
>    
Hello Asgaroth,

Comments inline
>> I have sent you another email in the thread but no reply. Can you
>> confirm that you have a listening UDP socket on the interface that is
>> selected by the kernel for sending the datagram in a mhomed
>> environment. If you are not listening on that interface Kamailio will
>> complain with the error message you received in mhomed=1 config
>>      
> I have my kamailio configuration as follows:
>
> listen=192.168.1.100:5060
> listen=192.168.2.100:5060
>
> And my linux server ip configuration is as follows:
>
> Where 192.168.1.99/192.168.2.99 is the ip address configured for the
> respective interfaces, and the 192.168.1.100/192.168.2.100 are the
> "virtual" interfaces created by ucarp.
>
> [root at testprxy #] ip addr show
>
> 2: eth0:<BROADCAST,MULTICAST,UP,LOWER_UP>  mtu 1500 qdisc pfifo_fast
> qlen 1000
>      link/ether 00:0c:29:9d:0d:c5 brd ff:ff:ff:ff:ff:ff
>      inet 192.168.1.99/24 brd 192.168.1.255 scope global eth0
>      inet 192.168.1.100/32 scope global eth0
>      inet6 fe80::20c:29ff:fe9d:dc5/64 scope link
>         valid_lft forever preferred_lft forever
> 3: eth1:<BROADCAST,MULTICAST,UP,LOWER_UP>  mtu 1500 qdisc pfifo_fast
> qlen 1000
>      link/ether 00:0c:29:9d:0d:cf brd ff:ff:ff:ff:ff:ff
>      inet 192.168.2.99/24 brd 192.168.2.255 scope global eth1
>      inet 192.168.2.100/32 scope global eth1
>      inet6 fe80::20c:29ff:fe9d:dcf/64 scope link
>         valid_lft forever preferred_lft forever
>
> Do I need to have kamailio listen on the 192.168.1.99/192.168.2.99
> addresses as well?
>
> I think currently the kernel my select 192.168.1.99 to route out to
> 192.168.1.x/24, and 192.168.2.99 to route out to 192.168.2.x. See
> routeing table below:
>
> [root at testprxy #] ip route show
> 192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.99
> 192.168.2.0/24 dev eth1  proto kernel  scope link  src 192.168.2.99
> default via 192.168.1.1 dev eth0
>
>    
Yes , for kamailio to send datagrams on those interfaces it has to 
explicitely listen on them.
> Now if I did something like:
>
> ip rule add from 192.168.1.100/32   table 100
> ip rule add to      192.168.1.100/32   table 100
> ip rule add to      192.168.1.0/24       table 100
> ip route add default via 192.168.1.1 table 100
> ip route add 192.168.1.0/24 dev eth0 src 192.168.1.100 table 100
>
> ip rule add from 192.168.2.100   table 101
> ip rule add to      192.168.2.100   table 101
> ip rule add to      192.168.2.0/24 table 101
> ip route add 192.168.2.0/24 dev eth1 src 192.168.2.100 table 101
>
> Would kamailio be able to use those interfaces then?
>
> Thanks
>
>    

The restriction is from a design/functionality p.o.v.  Kamailio must be 
able to receive a reply (response) on the interface it sends to. So if 
you can ensure that the kernel will choose one interface that kamailio 
is bound to, then you are ok, but if it choses one iface that kamailio 
does not listen, then you have no way of sending the datagram(and that 
error will appear).

I can't really say that the route table will work. One way I used for 
testing is via Ping or netcat without any local parameters. The choosing 
of the local address and port is left to the kernel, the same as 
kamailio with mhomed, so if you can find a suitable routeing table where 
only the ucarp interfaces are selected then you are ok. Why don't you 
listen also on 192.168.1.99/192.168.2.99 ?

Marius.
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>    




More information about the sr-users mailing list