[Spce-user] use eth0 for privat IPs and eth1 to make the trunk

Andreas Granig agranig at sipwise.com
Fri Feb 10 07:00:38 EST 2012


Hi David,

On 02/10/2012 12:09 PM, David wrote:
> Is it possible to configurer interface eth0 for clients with private IPs
> and use the eth1 with a public IP  to connect with the trunk?
> 
> I have been trying to change setting using the 'iaddress' with the
> private IP but it doesn't work.

That's not possible out of the box. iaddress is the wrong setting
anyways, it's used internally to communicate between lb and proxy and
sbc etc.

What you need to do is copying
/etc/ngcp-config/templates/etc/kamailio/lb/kamailio.cfg.tt2 to
/etc/ngcp-config/templates/etc/kamailio/lb/kamailio.cfg.customtt.tt2 and
then changing that config. You want to add an additional "listen"
option, which *should* do the trick if your interfaces are in different
networks (kamailio together with the kernel will figure out
automatically which outbound interface to use).

The other (additional) option if the above doesn't work is to call
force_send_socket() in the config manually, based on your selection
criteria, e.g:

listen=udp:1.2.3.4:5060
listen=udp:192.168.0.5:5060

route {
  # ...
  if(isflagset(FLAG_OUTBOUND) {
    # check for peering ip 1.2.3.5
    if($dd == "1.2.3.5" || ($du == $null && $rd == "1.2.3.5")) {
      force_send_socket("sip:1.2.3.4:5060");
    } else {
      force_send_socket("sip:192.168.0.5:5060");
    }
  }
}

Andreas




More information about the Spce-user mailing list