[asterisk-users] Use different local IP for each SIP trunk

Paulo Santos paulo.r.santos at sapo.pt
Tue Dec 20 03:56:41 CST 2011


Hello,

Douglas Mortensen wrote:
> With that said, then it appears that the only way that I can have
> multiple trunks setup with them is to have asterisk use a different
> IP for all of the SIP & RTP traffic for each given trunk. Essentially
> I would setup multiple IP addresses on my eth0 interface. Is there a
> way in asterisk that I could configure it to use one local IP for the
> source in all SIP/RTP traffic for 1 SIP trunk & then a different
> local IP for the other SIP trunk?

It's not an asterisk configuration but rather a interface configuration.
I need something similar and I use 2 IPs on the same port. In debian,
the configuration goes like this:

auto eth0
iface eth0 inet static
	address <ip1>
	netmask <netmask1>
	network <network1>
	broadcast <broadcast1>
	gateway <default_gateway>

auto eth0:0
iface eth0:0 inet static
	address <ip2>
	netmask <netmask2>
	up route add -net <network2> netmask <netmask2> gw <gw2>

And you can add more routes for other specific IPs/networks.


José Pablo Méndez Soto wrote:
> May I ask why do you need different IP addresses to source calls? I
> mean, its not a common practice, would like to understand the idea
> behind it.

In my case, the operator installed a gateway with a dedicated line and 
it's connected to the local network, but instead of being 192.168.0.0 
it's on 10.0.0.0. So I use this 2 networks in the same NIC in the 
asterisk machine.

Best regards,
Paulo Santos




More information about the asterisk-users mailing list