I prefer to use two NIC
1) with public IP;
2) with private IP.

Both NICs use routers as a gateway.
On Linux need to configure policy routing.

Probably you may want to use topos or topoh modules.


On Wed, Feb 9, 2022 at 7:14 PM Tihomir Culjaga <tculjaga@gmail.com> wrote:
Hi all 


I'm wondering what is best practice to configure kamailio for a setup shown below. Carriers only support interconnection over a private network so I need to terminate every separate network on kamailio machine (and on RTPEngine) . That will turn very quickly into an administration nightmare as we add more and more carriers.
My plan is to terminate carrier private networks on a router and NAT the traffic to kamailio where it leads me to a kamailio behind NAT setup. Well, in theory set_advertised_address and set_advertised_port per message can do the trick... at least I hope.
Also, some carriers require a SIP registration to activate SIP trunks. I do that using UAC module (remote registration) but here again I got a problem with contact address as you can set only one contact address (modparam("uac", "reg_contact_addr", "10.1.1.11:5060")). 

                    /--RTP 10000-19999-- RTPEngine1 -----RTP------+-- IPPBX1
carrier1 --- NAT ---|                       |                     |
                    |                       |                     |
carrier2 --- NAT ---+-----SIP 5060------ kamailio ----SIP---- Dispatcher
                    |                       |                     |
carrier3 --- NAT ---|                       |                     |
                    \--RTP 20000-29999-- RTPEngine2 -----RTP------+-- IPPBX2



So bottom line, I'm wondering what would be the best practice for such a scenario ?
That would spare me from hitting many pitfalls.

Would really appreciate a hint.

Regards,
Tihomir.



__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users