Tuesday, January 20, 2009

Enabling NAT on asterisk (see www.asterisk.org) using SSH client for Windows and Unix

NAT (network address translation) by definition is is the process of modifying network address information in datagram packet headers while in transit across a traffic routing device for the purpose of remapping a given address space into another.
The asterisk server doesn't have GUI so you need to use remote connection to configure it.


1. Remote asteisk via SSH Client (in this example we I used Putty).
2. Type the Host Name of IP address of asterisk and then connect through port 22.
3. In the console, enter the username and password provided by the administrator.
4. In the command line type cd /etc/asterisk
5. Next is edit the sip_nat.conf file using vi command (see www.unix-manuals.com/refs/vi-ref/vi-ref.htm for keys and commands) ex: vi sip_nat.conf
6. By default the sip_nat.conf file is empty, type the following scripts

7. Save the file and then exit.
8. After configuring the asterisk NAT you have to set redirection of port 5060 in your router.
9. Go to your router configuration and add redirection of port 5060 to the IP address of the trixbox (asterisk server).
10. After configuring the redirection, you can now register your softphone using the externalip defined in the configuration of asterisk NAT.
externalip is the domain where public connection can use to register for softphones (ex:Zoiper).
localnet is the IP range where private (inside your network) connection can use to register for softphones.