I am a asterisk Hobbyists,but recently I got troubles with asterisk behind nat.Well,you know that network environment is complex.So I want to test the performance of asterisk as a SIP UAS when it is behind nat and remote SIP UAC connecting to the Asterisk.I set up sip.conf like this:
nat = yes
externip = my_nat_public_ip
localnet = 192.168.122.0
;my remote extension
nat = yes
;adding these two parameters,some basic parameter for example context type,secret,host,port and so on don’t be mentioned here.
Then I login in NATdevice WEB UI and port forwarding my asterisk local IP and port 5060 to WAN port 5060(or I can also use DMZ function to expose my asterisk server IP ports to Internet).Having done these,My remote extension could connecting and register to my asterisk. But making use of DMZ and port forwarding function in the NAT Device is not safe for my asterisk,I think. Question 1: I want to know what meathod could I use to solve the problem that maintain the mapping between internal IP and port 5060 of my asterisk and public port 5060 without using DMZ or port forwarding. Question 2: Does asterisk support stun???How deeply asterisk support If it support? Thank you for reading this topic and any reply will be appreciated. Looking forwarding for your answers ASAP. Thank you again.