<span style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt"><br />
<span style="font-family: tahoma,arial,sans-serif; font-size: 10pt;"><hr width="100%" size="2" align="center" />
<b>From</b>: "Steve Davies" &lt;davies147@gmail.com&gt;<br />
<b>Sent</b>: Wednesday, January 11, 2012 12:51 PM<br />
<b>To</b>: "Asterisk Users Mailing List - Non-Commercial Discussion" &lt;asterisk-users@lists.digium.com&gt;<br />
<b>Subject</b>: Re: [asterisk-users] SIP and NAT best practices since recent changes?</span><br />
<br />
On 11 January 2012 15:43, Kevin P. Fleming &lt;kpfleming@digium.com&gt; wrote:<br />
&gt; On 01/11/2012 05:29 AM, Steve Davies wrote:<br />
&gt;&gt;<br />
&gt;&gt; Hi,<br />
&gt;&gt;<br />
&gt;&gt; Since the recent update to the NAT configuration options and defaults<br />
&gt;&gt; in chan_sip.so, I am interested in any SIP/NAT best practices advice.<br />
&gt;&gt;<br />
&gt;&gt; What I've always done in the past is:<br />
&gt;&gt;<br />
&gt;&gt; Global: nat=no<br />
&gt;&gt; SIP handsets that are local: nat=no<br />
&gt;&gt; SIP handsets that are remote: nat=yes<br />
&gt;&gt; ITSP SIP trunks: nat=yes<br />
&gt;&gt;<br />
&gt;&gt; I will then set externip and localnet to reflect the local setup,<br />
&gt;&gt; UNLESS there is a functional SIP ALG doing the work in the gateway<br />
&gt;&gt; device. I make this statement because I've found one or two firewalls<br />
&gt;&gt; where it is best to disable the SIP ALG, and one or two where it is<br />
&gt;&gt; best to leave it enabled.<br />
&gt;&gt;<br />
&gt;&gt; The above always worked very well, but I now find my asterisk logs<br />
&gt;&gt; being spammed with warnings containing lots of "!!" and I'd like to<br />
&gt;&gt; know the best way to operate to achieve what I've always had while<br />
&gt;&gt; following the new rules in order to be as secure as possible with<br />
&gt;&gt; "clean" logs. I should add that we do not accept unsolicited<br />
&gt;&gt; connections, and 99% of attempts to connect will be stopped at the<br />
&gt;&gt; firewall.<br />
&gt;<br />
&gt;<br />
&gt; The simplest answer is to always use 'nat=yes' (or at least<br />
&gt; 'nat=force_rport' in recent versions of Asterisk that support it), until you<br />
&gt; come across a SIP endpoint that fails to work properly with that setting. If<br />
&gt; you do come across such an endpoint, try hard to get it to work with that<br />
&gt; setting; if you can't, then set 'nat=no' for that endpoint, and understand<br />
&gt; that the endpoint's name could be discoverable using the attack methods<br />
&gt; previously disclosed. If the endpoint's configuration is suitably locked<br />
&gt; down (permit/deny, for example) this may not be a concern for you. If it's<br />
&gt; not locked down (for example, if it has to register to your Asterisk server<br />
&gt; from random locations), then the next step would be to seriously consider<br />
&gt; requesting that the user of that endpoint consider switching to some other<br />
&gt; SIP endpoint.<br />
&gt;<br />
&gt; To date, the only endpoints that have been identified that do *not* work<br />
&gt; with Asterisk's 'rport' handling forced upon them are Cisco phones.<br />
&gt;<br />
<br />
Excellent. Thanks as always Kevin.<br />
<br />
(Why am I not surprised about Cisco!)<br />
<br />
Regards,<br />
Steve<br />
<br />
Steve<br />
<br />
I can't get my grandstream phones to work with force_rport behind a pfsense firewall. but yes and comedia work fine. <br />
<br />
Bryant</span>