[SR-Users] Sending INVITE from loopback subnet

Alex Balashov abalashov at evaristesys.com
Mon Oct 8 13:26:33 CEST 2018


Hi Joonas,

Well, that's right -- Kamailio is not especially well-suited to
forwarding traffic among more than a handful of interfaces, for
precisely the reasons you have discovered. 

There are some ugly hacks around some of it available, but none are
pretty nor come recommended. 

-- Alex

On Mon, Oct 08, 2018 at 11:34:44AM +0300, Joonas Kamailio wrote:

> Dear List,
> 
> I am trying to achieve a scenario where I can recognize the original peer
> and mask it as peer from subnet 10.0.7.0/24 with kamailio. Basic IP
> connectivity is established with the following network configuration
> (Debian9):
> 
> auto lo:1
> iface lo:1 inet static
>         address 10.0.0.0/24
> 
> And of course I have routed 10.0.0.0/24 to servers public IP address (hereby
> known as x.x.x.1) in my router.
> 
> Please consider the following scenario:
> 
> - Peer1 192.168.0.1 is sending INVITE to kamailio at IP x.x.x.1
> - Kamailio sends INVITE to peer2 at 172.10.0.1 from socket 10.0.0.1
> - Peer2 receives the INVITE and knows that since it came from IP 10.0.0.1 it
> means that INVITE is originally from peer1
> - IF peer2 sends INVITE to kamailio, it should be sent to peerX from socket
> 10.0.0.2
> 
> This works if I list both 10.0.0.1 and 10.0.0.2 with 'listen=' parameter but
> things get out of hand if I have multiple peers. In my tests I have noticed
> that 60 peers equals 60 listen parameters which equals roughly 500 kamailio
> processes. At some point there are just too many processes and everything
> melts. If I omit the listen parameter altogether, kamailio has only one
> socket from /24 subnet and it is 10.0.0.0.
> 
> Error message when listen parameter is omitted:
> [pv_core.c:2612]: pv_set_force_sock(): no socket found to match [10.0.0.1]
> 
> My kamailio has the following configuration in request_route:
> 
> $avp(e_private) = $(sht(get_private=>$si));
> $fs = $avp(e_private);
> 
> I know that the case is a bit confusing and totally something normal people
> won't do. If you have any questions I am happy to answer.
> 
> Best Regards,
> Joonas Keskitalo
> 
> 
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list