cmac1.co.uk cmac1

Welcome Guest

Search:

Asterisk behind NAT

Print View
by: Chris McAndrew
Total views: 20
Word Count: 418

 

Your Asterisk server does not have to be on a public IP, DMZ, or other non-secure positions to be properly implemented. However you may experience one way voice issues due to NAT. The following is a list of parameters which can be added to your ‘sip.conf’ file in order to make it work.

 

sip.conf


port=


-> The port used by asterisk for the signalling (default=5060)

 

 Bindaddr=


-> The IP address on the machine asterisk has to bind to, put 0.0.0.0 to bind to all ports.

 

 Externip=


-> This is an option that has to be set in the [general] context at sip.conf and has to be set to either an IP or a hostname (pointing to the external IP on your NAT device).

If you want to use a dynamic hostname, you will have to reload the asterisk after every IP change.

e.g: externip=123.123.123.123


It will set the IP address in the sip address to the external ip instead of the internal IP.

You should only set it if asterisk is behind a NAT and trying to communicate with devices outside of the NAT.

 

 Localnet=


-> This is an option has to be set in the [general] context at sip.conf and has to be set to the netmask for the private network asterisk is in, this is only needed when asterisk is behind a NAT and trying to communicate with devices outside of the NAT.

e.g: localnet=192.168.10.0/255.255.255.0

 

 Nat=


->This option determines the type of setting for users trying to connect to an asterisk server.

Possible values:

 

a) NAT=Yes, true, y, t, 1, on

 

Qualify=


-> This option has a double function, it will keep open the NAT translation binding, and will make sure asterisk doesn’t try to send a call to this peer if it is unreachable.

Possible values:

 
a) Qualify=yes or qualify=0


These options will use the default value of 2 seconds.

b) Qualify=no


This will disable the checking of the peer.

c) Qualify=”some numeric value"


This will set the amount of ms between to checks”

 

 

rtp.conf

 

 rtpstart=


Takes a numeric value, which is the first port of the port range that can be used by asterisk to send and receive RTP.

 

 rtpend=


Takes a numeric value, which is the last port of the port range that can be used by asterisk to send and receive RTP.