Hello,
When binding Kamailio to 0.0.0.0, Kamailio no longer recognises any specific IP address homed on the system as being a "socket" for purposes of forcing traffic out of any specific interface (i.e. setting $fs), or any other purpose for which ingress and egress "sockets" are tracked (e.g. double RR).
As I understand it, this is because Kamailio considers only addresses explicitly specified via the 'listen' core config directive to be valid "send socket" arguments. Kamailio _will_ accept addresses already attached to the interface if it is bound interface-wise, e.g.
listen=eth1:5060
but not when addresses are added to the interface without restarting the proxy:
# ip addr add dev eth1 172.30.110.10/24
Aug 10 17:31:35 centosity6 /usr/local/sbin/kamailio[28627]: WARNING: pv [pv_core.c:2285]: pv_set_force_sock(): no socket found to match [udp:172.30.110.10:5060]
Is there any straightforward way to modify this behaviour, so that it would be possible to dynamically add addresses to existing physical interfaces and get Kamailio to utilise them as if they were bound at boot time?
Thanks,
-- Alex
Hello,
inaddr any is special as a single socket receiving all traffic, but then it has its own limitations when attempting to send.
Kamailio is building the list of sockets at startup and use that at runtime, so it is not possible to have a new socket added at runtime.
However, depending on what exactly you do, there can be variants at ip/network layer. Keep adding new sockets to an application can become inefficient, not matter how it is done.
So, as alternative, for example in the case of clients connecting via vpn tunnels, the best solution is to have kamailio listening on a single IP, then have masquerading of the tunnels to this ip. In other words, the clients will look at being behind nat from sip server point of view. The route to the IP of the sip server is pushed by th vpn client when connecting. The overall system has really low overhead, given that is practically ip forwarding.
That was the example with vpn, if you have other scenario, maybe you can give more details in order to see if there are other solutions.
Cheers, Daniel
On 10/08/15 23:34, Alex Balashov wrote:
Hello,
When binding Kamailio to 0.0.0.0, Kamailio no longer recognises any specific IP address homed on the system as being a "socket" for purposes of forcing traffic out of any specific interface (i.e. setting $fs), or any other purpose for which ingress and egress "sockets" are tracked (e.g. double RR).
As I understand it, this is because Kamailio considers only addresses explicitly specified via the 'listen' core config directive to be valid "send socket" arguments. Kamailio _will_ accept addresses already attached to the interface if it is bound interface-wise, e.g.
listen=eth1:5060
but not when addresses are added to the interface without restarting the proxy:
# ip addr add dev eth1 172.30.110.10/24
Aug 10 17:31:35 centosity6 /usr/local/sbin/kamailio[28627]: WARNING: pv [pv_core.c:2285]: pv_set_force_sock(): no socket found to match [udp:172.30.110.10:5060]
Is there any straightforward way to modify this behaviour, so that it would be possible to dynamically add addresses to existing physical interfaces and get Kamailio to utilise them as if they were bound at boot time?
Thanks,
-- Alex