Freepbx behind NAT issue

arun's picture

Hi Here is my setting.

PBX Firmware:
1.0.0.0

PBX Service Pack:
1.88.210.57-1

ISP : Time warner cable

Freepbx has a local IP address is 192.168.0.8
I have forwarded UDP 5060 and 5061 to the 192.168.0.8
I have forwarded UDP 10000 to 20000 to the 192.168.0.8

All I have done so far is created a couple of extensions. I cant seem to get my linksys Pap2 ATA register successfully to it. I have enabled NAT in all the extensions.

I have DynDns setup so that I have a public DNS available and Im able to ping to that.

In the proxy field I put my public DNS.

I have a syslog server running in the same network as the freepbx. and I have forwarded port 514 on my router for syslog to that PC.

I can see that request from the remote extension coming to the pap2 and the response from the pap2 via the syslog console.

Here is what I get from the syslog server console
19:09:55 117.193.67.226 Feb 7 06:40:13 0016B65E35A8 SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 192.168.2.2:5062;branch=z9hG4bK-4de07e9e;received=117.193.67.226
From: MyPBX ;tag=e521e88c8c6391ddo0
To: MyPBX
Call-ID: ad6aac88-72633e11@192.168.2.2
CSeq: 160 REGISTER
Server: YATE/3.3.2
Allow: ACK, INVITE, BYE, CANCEL, OPTIONS, INFO
Content-Length: 0

19:09:55 117.193.67.226 Feb 7 06:40:13 0016B65E35A8 SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 192.168.2.2:5062;branch=z9hG4bK-9140794;received=117.193.67.226
From: MyPBX ;tag=e521e88c8c6391ddo0
To: MyPBX
Call-ID: b7c19afc-2d09f42d@192.168.2.2
CSeq: 34206 REGISTER
Server: YATE/3.3.2
Allow: ACK, INVITE, BYE, CANCEL, OPTIONS, INFO
Content-Length: 0

19:09:55 117.193.67.226 Feb 7 06:40:13 0016B65E35A8 REGISTER sip:mypbx.getmyip.com SIP/2.0
Via: SIP/2.0/UDP 192.168.2.2:5062;branch=z9hG4bK-4de07e9e
From: MyPBX ;tag=e521e88c8c6391ddo0
To: MyPBX
Call-ID: ad6aac88-72633e11@192.168.2.2
CSeq: 160 REGISTER
Max-Forwards: 70
Event: keep-alive
User-Agent: Linksys/PAP2-3.1.12(LS)
Content-Length: 0

19:09:55 117.193.67.226 Feb 7 06:40:12 0016B65E35A8 REGISTER sip:mypbx.getmyip.com SIP/2.0
Via: SIP/2.0/UDP 192.168.2.2:5062;branch=z9hG4bK-9140794
From: MyPBX ;tag=e521e88c8c6391ddo0
To: MyPBX
Call-ID: b7c19afc-2d09f42d@192.168.2.2
CSeq: 34206 REGISTER
Max-Forwards: 70
Contact: MyPBX ;expires=3600
User-Agent: Linksys/PAP2-3.1.12(LS)
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: x-sipura

I have enabled SIP debug on from the CLI.
I dont see any activity on the asterisk CLI.

In addition to the port forwarding in my router, do I need to do anything in the freepbx server?

I see that fail2ban is running, is that something I mess with.

I have been using asterisk for couple of years now and I always put my server and DMZ and have not dealt with these issues. My Timewarner cable has a DMZ option but does not allocate a PUBLIC ip to my freepbx server. So Im trying to get it working with just the port forwarding.

This is driving me crazy...

Any help is really appreciated...


__________________


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

PBX Firmware? I don't even

SkykingOH's picture

PBX Firmware? I don't even know what that is? How was this system installed?

What version FreePBX? Have you configured the SIP NAT settings with your outside IP?


Skyking he's referring to

WizardOfDos's picture

Skyking he's referring to what shows up under system admin in the distro.

He's running 2.10 of the distro
Asterisk 1.8.8


__________________

A Decoy... Shazam!


What's not working

WizardOfDos's picture

Now apologies if I'm blind... i see a lot of config info... but what is the problem?

Remote phones? Registering to your sip provider? what are you trying to do that you can't do?

what's the 192.168.2.2 and the 117.193.67.226 addresses?


__________________

A Decoy... Shazam!


117.193.67.226 is a remote

arun's picture

117.193.67.226 is a remote extension 203 trying to register.
192.168.0.2 is a local extension that is trying to register.

Both does not succeed.

Here is link to a small set of the syslog output

http://dl.dropbox.com/u/30405631/SysLog.txt

Thanks for looking into this.

I do see that the 203 extension is trying to register to 5062 which I dont have forwarded. Im going to change that SIP port to 5060 in the Pap2 ATA config.

My other extension 200 is coming from a local network IP 192.168.0.2 and that is not able to register.

That is what worries me.


What does SIP show peers

tonyclewis's picture

What does SIP show peers show?


__________________

Tony Lewis
Schmooze Com, Inc.
FreePBX Developer


19:09:55 117.193.67.226 Feb

WizardOfDos's picture

19:09:55 117.193.67.226 Feb 7 06:40:13 0016B65E35A8 SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 192.168.2.2:5062;branch=z9hG4bK-4de07e9e;received=117.193.67.226

is 192.168.2.2 the local device ip on the far end? Is nat enabled on it? shouldn't it be registering with it's public ip?


__________________

A Decoy... Shazam!


Name/username

arun's picture

Name/username Host Dyn Forcerport ACL Port Status
200 (Unspecified) D N A 0 UNKNOWN
201 (Unspecified) D N A 0 UNKNOWN
203 (Unspecified) D N A 0 UNKNOWN
206 (Unspecified) D N A 0 UNKNOWN
4 sip peers [Monitored: 0 online, 4 offline Unmonitored: 0 online, 0 offline]

This is what I get.

I did enable nat=yes in the freepbx GUI. and on the remote ATA settings I NAT enabled and NAT keep alive msg set to $REGISTER and destination to $PROXY


I ask again did you setup

SkykingOH's picture

I ask again did you setup external and local net in sip settings?

Have you reviewed the copious documentation on the web concerning NAT and SIP? We also don't suggest exposing the system to the Internet,you should use a VPN.


I have configured the NAT

arun's picture

I have configured the NAT settings from the freepbx GUI.

Here is what I see in the sip_general_additional.conf
nat=yes
externip=192.168.0.8
localnet=192.168.0.0/255.255.255.0

My freepbx is sitting behind NAT.


You have your private IP in

SkykingOH's picture

You have your private IP in externip instead of your public.


I have changed it

arun's picture

I have changed it to

nat=yes
externip=76.187.79.7
localnet=192.168.0.0/255.255.255.0

Still the same result.

Do we need to open any ports from within the CENTOS in addition to the port forwarding setup in the router


You very likely have not

AdHominem's picture

You very likely have not configured your Asterisk SIP Settings correctly.

Before you go any further, I suggest you read the following:

http://www.freepbx.org/support/documentation/installation/first-steps-af...

and

http://www.freepbx.org/support/documentation/howtos/howto-setup-a-remote...

I strongly recommend that you not use remote extensions at all. If you absolutely must have a remote user, it is far better to:

1. Set up the external phone with its own FreePBX system and use IAX Trunks to connect your two systems together. This can be done without forwarding ANY ports at all.

or

2. Have the external phone register to SIP Service like voip.ms or callcentric, and use their internal call routing options to route the calls into your system.


I just create a test

arun's picture

I just create a test extension with the following information.

extension 222
display name test
secret test123

everything is left to the default of freepbx.

my public IP is 76.187.79.7

If you need to test it.