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

Asgaroth 00asgaroth00 at gmail.com
Tue Mar 29 14:32:04 CEST 2011


Hi Marius,

> 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

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



More information about the sr-users mailing list