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

    Port Forward is Ignored

    Scheduled Pinned Locked Moved NAT
    8 Posts 5 Posters 685 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.
    • G
      gerardshebert
      last edited by

      I am aware this will be something I'm doing wrong.

      I copied a working Port Forward (33333->32400) and changed the IP and ports to be (27020->27020), but it's not working. Changing it to (27270->27020) didn't help. I'm testing from CanYouSeeMe. 33333 always succeeds and 27020 always fails. In Status -> System Logs -> Firewall the rule blocking 27020 is 'Default deny rule IPv4'. The destination listed is my public IP. I clicked the + to create an EasyRule and it's listed in Firewall -> Rules -> WAN, but the port tests still fail.

      08f82fcb-16c2-4519-9de4-a46fb902a21b-image.png

      9f11e091-9ccc-4a1e-b360-e29246efee91-image.png

      2ba4b0f4-c2c1-4c8d-8e8f-df185913f08b-image.png

      Any guidance would be appreciated.

      J chpalmerC johnpozJ 3 Replies Last reply Reply Quote 0
      • J
        Jarhead @gerardshebert
        last edited by

        @gerardshebert Copying Port Forwards is not a good idea.
        Just delete the none working one and create it from scratch.

        1 Reply Last reply Reply Quote 0
        • chpalmerC
          chpalmer @gerardshebert
          last edited by

          @gerardshebert Unless those addresses on your LAN are public somehow there is no reason to obfuscate them.

          Your port forward is obviously wrong somehow based on your firewall logs there..

          If you can post a screenshot of the port forward setup page here that would help.. but always nice to know for me when I mess up where I did it..

          Triggering snowflakes one by one..
          Intel(R) Core(TM) i5-4590T CPU @ 2.00GHz on an M400 WG box.

          1 Reply Last reply Reply Quote 0
          • G
            gerardshebert
            last edited by

            Thank you for replying. Rebuilding the Port Forward rule from scratch did not change anything.

            I tested changing the NAT IPs and ports around and discovered that successful tests follow port 33333.
            I tested both rules with (33333->32400 on IP .15) and (33333->27020 on IP .6) and the port test succeeded all four times.
            Both rules fail with (27020->32400) and (27020->27020). (33332->32400) and (33332->27020) also fail.

            So, the Port Forward rule works. The problem is I cannot add more ports to forward. I will root around and may even pay for Support on this one because I'm starting to take it personally. I'll post an update once it's fixed.

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @gerardshebert
              last edited by johnpoz

              @gerardshebert said in Port Forward is Ignored:

              Hmmm.. Looks to me like your Port forward is not taking place, if was the firewall rule would show evaluations. But it shows 0/0 and no you have no rules that allow 27020 so yeah your default deny on want would trigger. Because your wan rule is to allow to your .6 address. But if not translated with your port forward then no that rule would never trigger.

              So you have to figure out why the port forward is not being applied..

              Doesn't matter what port you want to send it too.. If it doesn't actually apply then yeah your default deny will block traffic to your .6 address.

              Look in logs.. when you apply a port forward you should see it applied..

              portforward.jpg

              See that last image there - that is the rule being viewed with

              pfctl -sn

              https://docs.netgate.com/pfsense/en/latest/firewall/pf-ruleset.html

              edit: I would put a description on the rule - and then make sure you do a filter reload, to see it process it

              desc.jpg

              And would be good to see what is actually loaded via that pfctl -sn command

              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
              • G
                gerardshebert
                last edited by

                SOLVED!!

                Thanks @johnpoz your info made me re-examine the rule reload which had always shown the new rules being created, but I finally noticed the output never stated 'Done'. Instead it was stopping at:

                There were error(s) loading the rules: /tmp/rules.debug:36: cannot define table pfB_Africa_v4: Cannot allocate memory - The line in question reads [36]: table <pfB_Africa_v4> persist file "/var/db/aliastables/pfB_Africa_v4.txt"

                Which led me to "/topic/176932/error-tmp-rules-debug-36-cannot-define-table-pfb_pri1_v4-cannot-allocate-memory" which made me decide to uninstall pfBlockerNG which allowed the rule reload process to get to 'Done'. I uninstalled it because Africa is the first line in the list and increasing the Firewall Maximum Table Entries in System -> Advanced -> Firewall & NAT to 700000 got it as far as Europe before erroring again. Increasing the value to 1000000 took care of it, but there's nothing I'm doing that should require increasing a value to 2.5 times the default.

                The moral of the story is, if the log doesn't state 'Done', the rule reload failed and nothing changed.

                That pfctl -sn was very helpful too.

                Thanks, everyone for helping me out.

                S 1 Reply Last reply Reply Quote 0
                • S
                  SteveITS Galactic Empire @gerardshebert
                  last edited by

                  @gerardshebert FWIW long ago the advice I’d read here was, if using pfBlocker, set that max to 2 million and increase if necessary.

                  There is also the “don’t block the world, allow your country” discussion which takes much less memory.

                  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!

                  johnpozJ 1 Reply Last reply Reply Quote 1
                  • johnpozJ
                    johnpoz LAYER 8 Global Moderator @SteveITS
                    last edited by

                    @SteveITS said in Port Forward is Ignored:

                    There is also the “don’t block the world, allow your country” discussion which takes much less memory.

                    ^Exactly - I use this method.. I only want US ips and currently Belgium (family living there using my plex) - so I just allow those in my port forwards and wan rules.. This by its very nature blocks all the other ones.. No reason to load up into the tables of bad countries IP of them, all need to load is the IPs that are US and Belgium.

                    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
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.