The pfSense Store

Author Topic: source port different after passing through NAT  (Read 1104 times)

0 Members and 1 Guest are viewing this topic.

Offline thexder1

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
source port different after passing through NAT
« on: June 18, 2012, 05:37:42 pm »
I have a PFsense router setup with NAT internally. I have a PBX system running freePBX and I have a wholesale SIP trunk from Gafachi. The problem that I am running into is that the source port on the audio is not the same when the router forwards the packet to Gafachi as it is when the PBX sends it. Apparently Gafachi requires that the source port be the same as the port that they use as a destination port for the audio. This problem seems to have just started with no changes being made to the configuration of PFsense, or the PBX. I am not sure why I did not see this problem before, or why it seems to have shown up out of nowhere, but I need to find out why the source port is changing and get it fixed. Does anyone have an idea on what I need to do to fix this?

I am running PFsense 2.0 on a computer with a core 2 duo processor, I have 3 network connections on it, 1 is going to the internet, 1 is going to most of the internal network, and the last one is connecting to the PBX.
« Last Edit: June 18, 2012, 05:39:54 pm by thexder1 »

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9995
  • Karma: +3/-0
    • View Profile
Re: source port different after passing through NAT
« Reply #1 on: June 18, 2012, 05:51:45 pm »
I need to find out why the source port is changing and get it fixed.

Change the outbound nat mode do manual and create an outbound nat rule to your sip server with static port option selected.

Offline thexder1

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: source port different after passing through NAT
« Reply #2 on: June 18, 2012, 06:37:28 pm »
I think that might work, but right now that seems to have completely broken it. for some reason no matter what I try it looks  like it is not translating the address at all. I am not sure why it is doing that. Probably a setting that I am not aware of.

Offline thexder1

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: source port different after passing through NAT
« Reply #3 on: June 18, 2012, 06:59:48 pm »
NM I figured out that part of it. Now I have to get Gafachi to fix a problem on their end and I think I will have it working now.

Offline dhatz

  • Hero Member
  • *****
  • Posts: 1002
  • Karma: +0/-0
    • View Profile
Re: source port different after passing through NAT
« Reply #4 on: June 18, 2012, 07:02:07 pm »
You can try static-port as marcelloc suggested, but generally speaking most providers have no issues with port rewriting (which is pfsense's default behavior since v2.x).

Offline thexder1

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: source port different after passing through NAT
« Reply #5 on: June 18, 2012, 07:59:53 pm »
I got it to work. This is not the first time that I have had to do setup like this to get the Gafachi trunk working. I will be switching to a different provider as soon as possible since this is the second time they seem to have changed the setup on their end without notification and caused my phone system to go down, right in the middle of doing a lot of advertising.