[asterisk-users] chan_sip sending from wrong source address when multiple interfaces are used
Kevin P. Fleming
kpfleming at digium.com
Thu Jul 12 13:11:24 CDT 2012
On 07/12/2012 12:38 PM, Freddi Hansen wrote:
> We have since Asterisk 1.2 been using a configuration with 6 NIC's
> bonding to 3 networks, one public internet and 2 private networks.
> Routing calls between networks and having phones on all 3 networks is no
> problem.
>
> There is one case though where we do fixup with iptables.
> We have 30 virtuel adresses on one of the private networks and when
> Asterisk sends a packet to a destination then the first address of the
> NIC is inserted as source by the OS.
>
> example
> one NIC has ip's
> 192.168.0.10,192.168.0.20,192.168.30
> Telephone (192.168.0.100) sends a packet to Asterisk 192.168.0.30,
> Asterisk sends response to 192.168.0.100 but with source address
> 192.168.0.10 as thats the first ip on that NIC.
>
> In Iptables OUTPUT q we do a set-mark to an index into our source ip's
> then in POSTROUTING we insert the source adr using the mark
Yes, this is the situation I referred to earlier. In your case, it's all
on one interface, but the server has multiple addresses on the *same*
network, and thus it cannot know (without help) with address should be
used for outbound packets.
--
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kfleming at digium.com | SIP: kpfleming at digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com & www.asterisk.org
More information about the asterisk-users
mailing list