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

    Manual Outbound NAT Does Not Work

    Scheduled Pinned Locked Moved NAT
    19 Posts 4 Posters 5.0k 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.
    • stephenw10S
      stephenw10 Netgate Administrator
      last edited by

      You are able to set the source port in the customers application?
      Are you sure you've understood the difference between the source and destination ports? Neither of those are the translated nat port.
      Look at my test rule. The source port is 'any' because my browser/OS chooses a port at random, I have no way of knowing what it will be.

      Steve

      1 Reply Last reply Reply Quote 0
      • M
        mehmetyayla
        last edited by

        Steve,
        That's right.
        We're using diffrent software our local network. For this reason, this software will be select . it should not random port.

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          Ok, well even if you can set the source port setting the rule to 'any' will still catch the traffic as long as the destination port is correct, 1251 in your example.

          Have you tested it?

          Steve

          1 Reply Last reply Reply Quote 0
          • T
            timthetortoise
            last edited by

            mehmetyayia, assuming that what you're trying to achieve is outgoing port 1251 to be translated to outgoing port 25, Steve is correct - set your source port to any, and the destination port to 1251. The source port is 99% of the time an ephemeral port on the client accessing the service (in this case, your specialized machine). You can confirm this on the machine by running 'netstat -an | grep :1251' in *nix or 'netstat -an |  find ":1251"' in Windows. If it's in the second IP address column, that is the destination port. If it's in the first, it is indeed the source port. My bet is it's in the destination.

            1 Reply Last reply Reply Quote 0
            • M
              mehmetyayla
              last edited by

              thank you all,

              I did your said appropriate. Final rule is atached.

              I didn't tried yet. Because I'm away from our office.

              I'll give your information.

              pfrule.png
              pfrule.png_thumb

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                The source address must be 'LAN net' not 'LAN address'. Sorry I missed that before.

                Steve

                1 Reply Last reply Reply Quote 0
                • M
                  mehmetyayla
                  last edited by

                  Steve,
                  There are only lan subnet and lan address in the source adress . I'm using LAN subnet.
                  is it?

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    Yes 'LAN subnet'. It's displayed as 'LAN net' in the rule table. Confusing.  ;)

                    Steve

                    1 Reply Last reply Reply Quote 0
                    • M
                      mehmetyayla
                      last edited by

                      Steve,
                      really thank you for everything. I'll try today and than I'll back to you.

                      1 Reply Last reply Reply Quote 0
                      • P
                        phil.davis
                        last edited by

                        @stephenw10:

                        Yes 'LAN subnet'. It's displayed as 'LAN net' in the rule table. Confusing.  ;)

                        There have been enough queries about this inconsistency, I bit the bullet and submitted a pull request to make it all say "LAN net", "WAN net" rather than using "subnet" in some places:
                        https://github.com/pfsense/pfsense/pull/902
                        Took only a few minutes to make the changes, we will all save more time than that in answering queries.

                        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

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