• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

port forward ranges

Scheduled Pinned Locked Moved NAT
12 Posts 3 Posters 1.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    frog
    last edited by Nov 28, 2023, 4:44 PM

    Hi I am having trouble with port forwarding on the wan interface. I need to allow RTP to an internal sip phone system and it looks like the nat rule using a range between 6000:40000 takes the external rtp port eg 7762 and maps it's to 6000 on the internal device 192.168.11.151

    I need to to map the ports range from 6000:40000 to the same port number internally. So if coming in from 7762 to forwards 7762 internally to 192.168.11.151

    any help greatly appreciated.

    F 1 Reply Last reply Nov 28, 2023, 4:53 PM Reply Quote 0
    • F
      frog @frog
      last edited by frog Nov 28, 2023, 5:00 PM Nov 28, 2023, 4:53 PM

      I get no outbound audio when I call in from the outside. eg remotely I can't hear them but they can hear me.
      nat.png
      rule.png

      The log below shows it going to the wrong port

      log.png

      J S 3 Replies Last reply Nov 28, 2023, 5:02 PM Reply Quote 0
      • J
        johnpoz LAYER 8 Global Moderator @frog
        last edited by Nov 28, 2023, 5:02 PM

        @frog 25318 is the source port.. Not the destination port..

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • S
          SteveITS Galactic Empire @frog
          last edited by Nov 28, 2023, 5:32 PM

          @frog Most commonly the source port on a connection is a random port and should be "any."

          Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
          When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
          Upvote 👍 helpful posts!

          1 Reply Last reply Reply Quote 0
          • J
            johnpoz LAYER 8 Global Moderator @frog
            last edited by johnpoz Nov 28, 2023, 6:46 PM Nov 28, 2023, 6:36 PM

            @frog so for an example. Here I created a port range forward of ports 6000-7000. I then using a online tool to send a UDP packet to specific port I used https://www.ipvoid.com/udp-port-scan/ to send UDP on port 6500, this is in the range I am forwarding.

            sniff.jpg

            So I did 2 captures so the source ports changed. But you can see that when I send traffic to port 6500 and it hits my wan.. Then when it sends it on to where I forwarded, in this case my 192.168.9.100 box the destination port is whatever port hit on my wan.. Its not changed..

            While you can change the port that is sent, so X could hit your wan and you could forward to Y on your internal - when you do a range and the range on the wan matches up with the range your sending - it should send the to the same port..

            And as mentioned @SteveITS it is rare that you would set the source port on your forward.. This is almost always left at any, because you normally do not know what source port the traffic would come from..

            edit: here I ran sniff at same exact time one on my wan, other on my lan.. Notice the traffic comes in from source port 50163 which doesn't change and traffic hit my wan to port 6700, and forwarded to my 192.168.9.100 box on port 6700 from the same source port 50163

            differentport.jpg

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            F 1 Reply Last reply Nov 29, 2023, 8:14 AM Reply Quote 1
            • F
              frog @johnpoz
              last edited by frog Nov 29, 2023, 8:22 AM Nov 29, 2023, 8:14 AM

              Still no joy.

              nat.png rule.png
              9ee673a9-5a4a-4e1f-9cb6-a64f8f91b2f6-image.png

              c2fa2c9e-f709-4b64-b0d3-0ee9a45ec428-image.png

              and I have try with the source as any rather than locking it down to specific ips

              J S 2 Replies Last reply Nov 29, 2023, 10:40 AM Reply Quote 0
              • J
                johnpoz LAYER 8 Global Moderator @frog
                last edited by Nov 29, 2023, 10:40 AM

                @frog not sure why you think a source port being different than why you think the source port being X and your destination being Y is your problem.

                If they sent you traffic on port 6000 from a source port of 20930 that is what pfsense is going to send to the client.

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                F 1 Reply Last reply Nov 29, 2023, 10:43 AM Reply Quote 0
                • F
                  frog @johnpoz
                  last edited by Nov 29, 2023, 10:43 AM

                  @johnpoz just that I have no audio outbound when an external call is made to the phone system.

                  J 1 Reply Last reply Nov 29, 2023, 10:49 AM Reply Quote 0
                  • J
                    johnpoz LAYER 8 Global Moderator @frog
                    last edited by Nov 29, 2023, 10:49 AM

                    @frog and your pfsense wan is a public IP right, its not some rfc1918 IP address behind your isp device..

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 24.11 | Lab VMs 2.8, 24.11

                    F 1 Reply Last reply Nov 29, 2023, 11:56 AM Reply Quote 0
                    • F
                      frog @johnpoz
                      last edited by Nov 29, 2023, 11:56 AM

                      @johnpoz I don't believe anything odd is happening re the public IP. It's a leased line but with only 2 useable IP's so a .252 subnet

                      J 1 Reply Last reply Nov 29, 2023, 12:26 PM Reply Quote 0
                      • J
                        johnpoz LAYER 8 Global Moderator @frog
                        last edited by Nov 29, 2023, 12:26 PM

                        @frog but the IP is on pfsense wan itself. Have seen issues when your behind a double nat.

                        I am not a voip guy.. But what your highlighting is not the problem. The source port is almost always different than the destination port.

                        You highlight your source port and destination port with a red line like this is the problem. pfsense is not going to change those.. As I showed you in my screenshots above.

                        There are way better people around here for voip stuff. I have seen issues with alg helper on router/firewall. Or the base port wrong on where your sending the forward.

                        Sometimes if one way audio could be that your outbound nat needs to be set to static outbound... When device behind pfsense creates a connection to some IP on the internet, normal napt will change the source port.. So you have 192.168.1.100:X wanting to talk to 1.2.3.4:7777 for example.. When pfsense changes the source IP to its public say 4.5.6.7 it will change that source port X to some other port, say Z.. This can be problematic with voip.

                        But again I am not a voip guy..

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.8, 24.11

                        1 Reply Last reply Reply Quote 0
                        • S
                          SteveITS Galactic Empire @frog
                          last edited by Nov 29, 2023, 2:24 PM

                          @frog you linked rule shows traffic/states, the numbers on the left.

                          Did you look at
                          https://docs.netgate.com/pfsense/en/latest/troubleshooting/nat-port-forwards.html
                          And the VOIP pages at
                          https://docs.netgate.com/pfsense/en/latest/recipes/index.html#firewall-nat

                          Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                          When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                          Upvote 👍 helpful posts!

                          1 Reply Last reply Reply Quote 0
                          12 out of 12
                          • First post
                            12/12
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                            This community forum collects and processes your personal information.
                            consent.not_received