Question

asterisk / sip / nat

Asked by: cenetadmin

I have a pix firewall and an asterisk computer behind it.  I have 2 grandstream telephones outside of the pix and behind linksys firewalls.  We can dial each other, but we can not hear each other.  How do I setup this up to hear each other.

Also I have to use qualify=2000 to keep the port open, but if the network is slow, the phone does not return back quick enough, is there a time out value I can set long to avoid this situation?

Here are the config files for the pix, asterisk, and sip:

 Saved

:

PIX Version 6.3(3)

interface ethernet0 auto

interface ethernet1 100full

nameif ethernet0 outside security0

nameif ethernet1 inside security100

hostname cenetstptrsrtr01

domain-name inetstptrsds.local

fixup protocol dns maximum-length 1024

fixup protocol ftp 21

fixup protocol h323 h225 1720

fixup protocol h323 ras 1718-1719

fixup protocol http 80

fixup protocol rsh 514

fixup protocol rtsp 554

fixup protocol sip 5060

fixup protocol sip udp 5060

fixup protocol skinny 2000

fixup protocol smtp 25

fixup protocol sqlnet 1521

fixup protocol tftp 69

names

object-group service RTP udp

  description For SIP

  port-object range 10000 20000

object-group service SIP udp

  description SIP port 5060-5061

  port-object eq 5060

access-list 102 permit tcp any host 67.103.170.6 eq 3389

access-list 102 permit tcp any host 67.103.170.7 eq 3389

access-list 102 permit tcp any host 67.103.170.6 eq pop3

access-list 102 permit tcp any host 67.103.170.6 eq smtp

access-list 102 permit tcp any host 67.103.170.7 eq https

access-list 102 permit tcp any host 67.103.170.7 eq www

access-list 102 permit tcp any host 67.103.170.8 eq www

access-list 102 permit tcp any host 67.103.170.9 eq www

access-list 102 permit tcp any host 67.103.170.10 eq www

access-list 102 permit tcp any host 67.103.170.11 eq www

access-list 102 permit tcp any host 67.103.170.12 eq www

access-list 102 permit tcp any host 67.103.170.13 eq www

access-list 102 permit tcp any host 67.103.170.14 eq www

access-list 102 permit tcp any host 67.103.170.15 eq www

access-list 102 permit esp any any

access-list 102 permit udp any any eq isakmp

access-list 102 permit udp any any eq 4500

access-list 102 permit udp any any eq 10000

access-list 102 permit tcp any host 67.103.170.18 eq www

access-list 102 permit udp any host 67.103.170.3 range 5004 5082

access-list 102 permit tcp any host 67.103.170.3 range 5004 5082

access-list 102 permit udp any host 67.103.170.3 range 10000 20000

access-list 102 permit tcp any host 67.103.170.3 range 10000 20000

access-list 102 permit udp any host 67.103.170.3 eq 4569

access-list 102 permit tcp any host 67.103.170.3 eq 4569

access-list 102 permit tcp any host 67.103.170.3 eq www

access-list 102 permit tcp any host 67.103.170.3 eq ssh

access-list 102 permit tcp any host 67.103.170.7 eq ssh

access-list 102 permit tcp any host 67.103.170.7 eq smtp

access-list 102 permit tcp any host 67.103.170.7 eq pop3

access-list 102 permit tcp any host 67.103.170.6 eq www

access-list 102 permit tcp any host 67.103.170.3 eq smtp

access-list 102 permit tcp any host 67.103.170.3 eq pop3

access-list 102 permit tcp any host 67.103.170.3 eq https

access-list nonat permit ip 192.168.2.0 255.255.255.0 192.168.254.0 255.255.255.0

access-list nonat permit ip 192.168.2.0 255.255.255.0 192.168.3.0 255.255.255.0

access-list vpnlist permit ip 192.168.2.0 255.255.255.0 192.168.3.0 255.255.255.0

access-list VPN_SPLIT permit ip 192.168.2.0 255.255.255.0 192.168.254.0 255.255.255.0

pager lines 24

logging monitor debugging

mtu outside 1500

mtu inside 1500

ip address outside 67.103.170.5 255.255.255.240

ip address inside 192.168.2.251 255.255.255.0

ip audit info action alarm

ip audit attack action alarm

ip local pool VPN_POOL 192.168.254.1-192.168.254.254

pdm logging informational 100

pdm history enable

arp timeout 14400

global (outside) 1 67.103.170.2

nat (inside) 0 access-list nonat

nat (inside) 1 0.0.0.0 0.0.0.0 0 0

static (inside,outside) tcp 67.103.170.6 pop3 192.168.2.22 pop3 netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.6 smtp 192.168.2.22 smtp netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.6 3389 192.168.2.22 3389 netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.7 3389 192.168.2.20 3389 netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.7 www 192.168.2.22 www netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.7 https 192.168.2.22 https netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.8 www 192.168.2.8 www netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.9 www 192.168.2.9 www netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.10 www 192.168.2.10 www netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.11 www 192.168.2.11 www netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.12 www 192.168.2.12 www netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.13 www 192.168.2.13 www netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.14 www 192.168.2.14 www netmask 255.255.255.255 0 0

static (inside,outside) tcp 67.103.170.15 www 192.168.2.15 www netmask 255.255.255.255 0 0

static (inside,outside) 67.103.170.4 192.168.2.99 netmask 255.255.255.255 0 0

static (inside,outside) 67.103.170.3 192.168.2.2 netmask 255.255.255.255 0 0

access-group 102 in interface outside

conduit permit udp any object-group RTP any

conduit permit udp any object-group SIP any

route outside 0.0.0.0 0.0.0.0 67.103.170.1 1

route outside 192.168.254.0 255.255.255.0 67.103.170.1 1

timeout xlate 0:05:00

timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00

timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00

timeout uauth 0:05:00 absolute

aaa-server TACACS+ protocol tacacs+

aaa-server RADIUS protocol radius

aaa-server LOCAL protocol local

http server enable

no snmp-server location

no snmp-server contact

snmp-server community public

no snmp-server enable traps

floodguard enable

sysopt connection permit-ipsec

telnet 0.0.0.0 0.0.0.0 inside

telnet timeout 5

ssh 0.0.0.0 0.0.0.0 outside

ssh 0.0.0.0 0.0.0.0 inside

ssh timeout 60

console timeout 0

dhcpd lease 3600

dhcpd ping_timeout 750

dhcpd auto_config outside

terminal width 80

: end

 

Here is my asterisk rtp configuration

 

;

; RTP Configuration

;

[general]

;

; RTP start and RTP end configure start and end addresses

;

; Defaults are rtpstart=5000 and rtpend=31000

;

rtpstart=10000

rtpend=20000

;

; Whether to enable or disable UDP checksums on RTP traffic

;

;rtpchecksums=no

;

; The amount of time a DTMF digit with no 'end' marker should be

; allowed to continue (in 'samples', 1/8000 of a second)

;

;dtmftimeout=3000

~

~

~

 sip.conf

[1131]

type=friend

nat=yes

canreinvite=yes

dtmfmode=rfc2833

disallow=all

allow=ulaw

allow=alaw

username=1131

secret=1131

host=dynamic

context=druid-default

callerid="1131" <1131>

mailbox=1131@default

video=no

restrictcid=no

qualify=2000

 

[1130]

type=friend

nat=yes

canreinvite=yes

dtmfmode=rfc2833

disallow=all

allow=ulaw

allow=alaw

username=1130

secret=1130

host=dynamic

context=druid-default

callerid="1130" <1130>

mailbox=1130@default

video=no

restrictcid=no

qualify=2000

Thanks

Eric

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2006-09-13 at 18:43:36ID21988853
Tags

asterisk

,

sip

,

nat

Topic

Voice Over IP

Participating Experts
2
Points
500
Comments
9

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Asterisk: port forward sip protocol to asterisk server
    i need to port forward sip protocol to asterisk server so that remot phones can get connected. i have a linksys router
  2. Asterisk SIP Registration Issues
    We have an Asterisk-based PBX system inside a firewall that has two Internet connections. The main Internet connection has an IP of 123.123.123.123 (just for the purposes of this posted question), and the backup connection has 456.456.456.456. Users at home with softphones ...
  3. SIP no audio - Asterisk [SonicWall TZ-190] <-> […
    I have an Asterisk v1.4.22 PBX on a LAN, protected by a SonicWall TZ-190 in Building 1. The PBX registers to an upstream SIP provider for phone service, and there are 5 phones (a mix of Polycom IP320s and analog phones connected to Linnksys PAP2T ATAs). Everything in buildi...
  4. Trunking in Asterisk
    Hi, I have a iAX trunk between two asterisk servers? These servers are connected through a VPN tunnel. Often the trunk goes down and we have to restart the server to get it functional. Can I configure a SIP trunk in parallel to iAX trunk and does asterisk reads each channel ...
  5. Asterisk
    Hi, I have installed a distribution based on Centos with Asterisk GUI VOIPER. Unfortunately, Centos did not recognize the network adapter of the machine which I later learned (and paid) that the correct driver for your card is JMC 2x0 with a string of installation directly fr...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: feptiasPosted on 2006-09-14 at 01:33:42ID: 17518710

In the Grandstreams, have you set a STUN server?

 

by: grbladesPosted on 2006-09-14 at 03:30:25ID: 17519159

In sip.conf I suggest you use the externip feature which will allow asterisk to put the correct IP address in its SIP packets. See http://www.voip-info.org/wiki/index.php?page=Asterisk+SIP+externip

 

by: cenetadminPosted on 2006-09-14 at 05:52:34ID: 17520185

On the grandstream phones I do not have a stun server.  I am sorry for not including the sip.conf file, I have already put the outside ip address in the externip section of the sip file.

Thanks

Eric

 

by: feptiasPosted on 2006-09-14 at 06:19:07ID: 17520392

I just got a Grandstream working this week with Asterisk, but it had to have an entry for STUN server. It is behind a NAT firewall - very similar to your setup. You can specify any stun server - it doesn't have to be one run by your service provider. e.g. stun.sipgate.net
The settings I am using on my Grandstream are:
local SIP port: 5060
local RTP port: 5004
Use random port: No
NAT Traversal: Yes, STUN server is: stun.sipgate.net
keep-alive interval: 20
Use NAT IP: <none>
Proxy-Require: <none>

If that doesn't work, you need to investigate why the RTP media isn't getting through your NAT firewalls. You might even be able to use port forwarding on the Linksys. RTP media uses UDP. On the pix you need to let UDP 10000 to 20000 through (you probably already do, but I am not familiar with pix). No NAT - or failing that dedicated one-to-one NAT - is the best option for the Asterisk server if possible.

 

by: cenetadminPosted on 2006-09-14 at 09:26:54ID: 17522124

is it possible to setup my own STUN server, since I do not have a service provider.  I am the service provider.  Can this server be behind a firewall, if so what ports need to be open?

Thanks

Eric

 

by: feptiasPosted on 2006-09-14 at 09:43:10ID: 17522270

I think you are slightly missing the point. The whole purpose of a STUN server is that it must be on the remote (WAN) side of your NAT router. Your phone communicates with it only very occassionally - e.g. when the phone is rebooted - and the STUN server performs a few simple tests then it tells your phone the outcome of those tests. For example it tells the phone what external IP address it appears to be on and what type of NAT router it is behind. This information is then used whenever the phone needs to communicate with a SIP server, such as Asterisk. It allows the phone to give better information to the SIP server about how it may be contacted through NAT.

It doesn't matter that you don't have a service provider. I don't either. You can still use other people's STUN servers because there is no login or authentication required. All you need to know is the IP address or URL. I gave you an example - stun.sipgate.net. It is a bit like using an NTP time server - the provider doesn't charge for the service and all you need to know is the address of their server.

 

by: cenetadminPosted on 2006-09-14 at 15:16:41ID: 17524888

When I added the stun server, the grandstream said that it is an open internet connect and also it becomes unregistered from the asterisk server.  If I configured the grandstream to no and keep alive it at least dials, but still does not talk.

Any other suggestions?

Thanks

Eric

 

by: feptiasPosted on 2006-09-15 at 00:55:57ID: 17527309

I assume the Linksys firewalls are also NAT routers. If so, then the Grandstream Status screen should be showing something like this:
NAT: Detected NAT type is full cone
NAT Mapped IP: <the Internet IP address of the Linksys>
NAT mapped port: 33950   (or whatever)

If it was showing "open Interent connection" then it got it wrong and has no hope of working.

All I can suggest is that you try again. Set the STUN server as already described, then power off the Grandstream for several minutes, then power it back on again. Preferably, wait for (or force) the phone to stop being registered on Asterisk before you power it back on.

In my experience, specifying a STUN server is more often helpful than not. However, SIP through NAT (or worse still through double NAT) is still a black art and what works for one case may not work for all. If you want some other suggestions:
1. Try port forwarding on the Linksys for tcp port 5060, plus for all udp ports between 5000 and 50000. Forward to the Grandstream. If that works, try refining the range of udp ports set for forwarding (you will always need 5060, but the range required for the media packets shouldn't need to be so wide as I suggested)
2. Make it so the Asterisk server is not connected to the Internet through NAT (if it is)
3. Use "sip debug" on the Asterisk to examine the SIP packets when you make a call. You might be lucky and be able to see what is going wrong by examining the SIP messages and looking at the IP addresses being used.
4. Try other routes for calls to/from the Grandstream - i.e. not just one Grandstream to the other via Asterisk. Set a script in Asterisk that will just play a voice file when it is called. Can you hear the voice file when you call that service using each Grandstream.
5. Set up a site-to-site VPN tunnel from the Linksys to the pix and send all your VoIP traffic through the tunnel. I expect you would need a more upmarket router than the Linksys for this to be possible. You would also want to use compression such as G.729 to reduce the load going through the VPN tunnel, but that means buying licenses for the Asterisk.
6. Replace the Linksys firewall/router with a UK Draytek Vigor 2100VG (or similar) that has the VoIP phone built-in to the router because this avoids the need to traverse NAT and you just plug an ordinary POTS phone into the Draytek. The Draytek routers sold in the UK can be used with any SIP service, but in the US they are locked to specific SIP service providers so are unsuitable for use with Asterisk.

 

by: cenetadminPosted on 2006-09-15 at 05:10:15ID: 17528710

The Grandstream was not taking the stun server, after I put another one in, it magically worked....  Thanks for your assistance.

Thanks

Eric

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...