[asterisk-users] Sip phones on localnet AND outside localnet problem

Marcus Wells marcus at vasc.co.nz
Thu Nov 19 18:05:53 CST 2009


Hi list

I am having trouble getting asterisk to perceive the firewall's ip address as outside localnet (setting in sip.conf). The situation is this:
- phones inside lan work fine when localnet is set to 192.168.0.0/255.255.255.0
- phones outside the lan can't ack the invite from asterisk because asterisk perceives the outside phone to originate from localnet as DNAT is done with iptables and the incoming ip address is rewritten (i'm assuiming) to the firewall's internal ip address (192.168.0.20) (so from and contact are 192.168.0.21, this is the asterisk box's private ip)
- If i set localnet to 10.0.0.0/255 asterisk puts the externip in the from and contact fields and it works fine with an external phone
- I haven't tested it yet, but i don't think a sip phone in the lan with the asterisk box will work if an incorrect localnet is set!

Can anyone help or offer a workaround for this to allow sip phones in the lan as well as outside to work? Is it possible to mangle the packets with iptables in postrouting so that they don't have the firewall's ip address when received by asterisk?

Is there a setting in sip.conf that can make the firewall ip appear as non-local even though it is in the localnet setting?

Thanks for any help!

Marcus



More information about the asterisk-users mailing list