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

    Port forwarding - what am I doing wrong?

    Scheduled Pinned Locked Moved NAT
    12 Posts 4 Posters 1.2k 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.
    • ColinJackC
      ColinJack
      last edited by

      This should be a very straight forward job ... but I must have something wrong because it isn't working!
      I want to be able to use a non-standard port (589) for incoming SMTP connections to an internal server listening on port 25.
      0_1542820686965_Capture.JPG
      I am sure I am being thick but .... I can't see what I am missing.
      I have dozens of standard port forwarding working (80 <> 80 etc.)
      Source and source port are set to any.

      Thanks

      Colin

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

        Is the port internalserver:25 open in that server's firewall?
        Is the associated firewall rule correct? (it should update automatically, but...)

        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
        • ColinJackC
          ColinJack
          last edited by

          Yes - port 25 is accepting mail on the internal server. This is how it is currently working.
          I want to change this to a non-standard port to reduce spam. We are forwarding from a seperate external spamfilter.
          I checked the associated rule (just in case) and it looks fine:
          0_1542821965707_Capture.JPG
          This should be simple ... but for some reason it won't work.

          Colin

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

            External servers such as mine would never look for your server on that port.. But I suppose that is your goal. Then what have you done on the other side to make your intended incoming servers look for that port?

            Do a packet capture and see if it is even getting to you.

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

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

              @colinjack Did you try to delete and recreate the NAT forward? The only thing you've obscured is the public IP you're connecting to, but if one assumes that's correct then I am not seeing anything wrong.

              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!

              ColinJackC 1 Reply Last reply Reply Quote 0
              • ColinJackC
                ColinJack @SteveITS
                last edited by

                @teamits said in Port forwarding - what am I doing wrong?:

                @colinjack Did you try to delete and recreate the NAT forward? The only thing you've obscured is the public IP you're connecting to, but if one assumes that's correct then I am not seeing anything wrong.

                Yes - done that twice. Not a lot to get wrong really.
                Have now set up an identical rule to a non-production server to test but same result.
                Strange. I am not a complete firewall noob so thought this would be a simple job! :)
                Thanks for checking ... I will now go and bang my head on the desk.

                1 Reply Last reply Reply Quote 0
                • ColinJackC
                  ColinJack @chpalmer
                  last edited by

                  @chpalmer said in Port forwarding - what am I doing wrong?:

                  External servers such as mine would never look for your server on that port.. But I suppose that is your goal. Then what have you done on the other side to make your intended incoming servers look for that port?

                  Do a packet capture and see if it is even getting to you.

                  That is exactly the reason I am doing this.
                  MX records for mail on that that server point to an external spam filter which then forwards on the 'new' port. I am testing using telnet.

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

                    In your port forward the dest would be the wan address... Is that some vip you setup or something with server 6?

                    You are correct this is drop dead simple... It should take 2 seconds to create a port forward... If its not working then run through the guide to figure out where your issue is..

                    A sniff on your wan interface will tell you if the traffic is getting there - if it doesn't get there then pfsense can not do anything.. So your problem is upstream.. If it gets there does it get sent to the correct lan side IP... Does that lan side device use pfsense as its gateway? Is it running a firewall, etc.
                    https://www.netgate.com/docs/pfsense/nat/port-forward-troubleshooting.html

                    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

                    ColinJackC 1 Reply Last reply Reply Quote 0
                    • ColinJackC
                      ColinJack @johnpoz
                      last edited by

                      @johnpoz said in Port forwarding - what am I doing wrong?:

                      In your port forward the dest would be the wan address... Is that some vip you setup or something with server 6?

                      You are correct this is drop dead simple... It should take 2 seconds to create a port forward... If its not working then run through the guide to figure out where your issue is..

                      A sniff on your wan interface will tell you if the traffic is getting there - if it doesn't get there then pfsense can not do anything.. So your problem is upstream.. If it gets there does it get sent to the correct lan side IP... Does that lan side device use pfsense as its gateway? Is it running a firewall, etc.
                      https://www.netgate.com/docs/pfsense/nat/port-forward-troubleshooting.html

                      Server 6 is mapped to a global IP using virtual ip. I can connect on port 25 no problem using telnet (exisitng port forward), so I know that that all works. It is just connecting to 586 that doesn't ... it is if the NAT isn't translating correctly.

                      Basically you are checking if it is setup correctly - but that is all working.
                      I can connect from outside on port 25 no problem ... so all the usual suspects (gateway etc.) are fine. All I am wanting to do is change the incoming port from 25 to 589 for email.

                      It is getting to the WAN interface okay:

                      18:53:41.787016 IP 91.135.23.121.13900 > 208.67.249.242.589: tcp 0
                      18:53:41.787442 IP 208.67.249.242.589 > 91.135.23.121.13900: tcp 0

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

                        Looks like you got an answer.. was that a RST?

                        since you posted your IP I sent a syn to 589 and yeah get back RST!!!

                        0_1542828588796_gotbackRST.png

                        So in layman terms thats a Fuck Off ;) Pfsense would not do that.. So much be where your sending it too... Since on the lan side..

                        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

                        ColinJackC 2 Replies Last reply Reply Quote 1
                        • ColinJackC
                          ColinJack @johnpoz
                          last edited by

                          @johnpoz said in Port forwarding - what am I doing wrong?:

                          Looks like you got an answer.. was that a RST?

                          since you posted your IP I sent a syn to 589 and yeah get back RST!!!

                          0_1542828588796_gotbackRST.png

                          So in layman terms thats a Fuck Off ;) Pfsense would not do that.. So much be where your sending it too... Since on the lan side..

                          Okay - but if I telnet on port 25 it connects okay.
                          Does that maybe mean that it is trying to connect on the LAN server on 589 rather than 25?
                          i.e. not translating?
                          It is a Centos box ... where can I look in the logs to find that? Nothing in messages.
                          Thanks for the help.

                          1 Reply Last reply Reply Quote 0
                          • ColinJackC
                            ColinJack @johnpoz
                            last edited by

                            @johnpoz Thanks - sorted!

                            I have a bunch of ports that are included as a single port alias and one rule is used to port forward ... and that bunch included 25.
                            Removed port 25 and hey presto.

                            @johnpoz letting me know where it was being bounced from helped. Thanks.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.