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

    Forwarded ports on my WAN IP from my LAN/OPTx networks

    Scheduled Pinned Locked Moved NAT
    13 Posts 6 Posters 2.7k 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.
    • D
      derek_bartram
      last edited by

      Thanks Derelict!

      LAN1 = 182.16.1.X/24
              ServerA = 182.16.1.10:80
              ServerB = 182.16.1.20:81
      LAN2 = 182.16.2.X/24
      WAN = 83.14.35.11/30

      WAN has a NAT rule to allow 83.14.35.11:80 to forward to 182.16.1.10:80, and another rule to allow 83.14.35.11:81 to forward to 182.16.1.20:81 - this works fine. My external domain name www.example.com routes to WAN address.

      Prior to pfsense deployment, I could do www.example.com:80 and hit server A, and www.example.com:81 and hit server B - both internally (LAN1/2) and externally.

      What I'm trying to avoid is having to define everything as ServerA.example.com, ServerB.example.com, etc.; there is sufficient information in the port number alone to make this work.

      The bit I'm struggling with is getting LAN1/2 to route as if coming from the external side of the firewall.

      1 Reply Last reply Reply Quote 0
      • K
        kpa
        last edited by

        182.16.1.0/24 is an allocated prefix for someone residing in Hong Kong, I don't think that's you?

        1 Reply Last reply Reply Quote 0
        • D
          derek_bartram
          last edited by

          @kpa:

          182.16.1.0/24 is an allocated prefix for someone residing in Hong Kong, I don't think that's you?

          You're right, it's not… it's an example range, which approximately mirrors my actual ranges.
          A little added security through obscurity.

          If you can point me in the right direction for that range, I can easily remap that onto my network.

          1 Reply Last reply Reply Quote 0
          • K
            kpa
            last edited by

            Disclosing the private RFC1918 addresses used on your LAN networks is totally harmless, an outside attacker gains no advantage from knowing them. There are officially allocated "example" ranges. First one is 192.0.2.0/24 and the other two are 198.51.100.0/24 and 203.0.113.0/24.

            https://tools.ietf.org/html/rfc5737

            1 Reply Last reply Reply Quote 0
            • D
              derek_bartram
              last edited by

              @kpa:

              Disclosing the private RFC1918 addresses used on your LAN networks is totally harmless, an outside attacker gains no advantage from knowing them. There are officially allocated "example" ranges. First one is 192.0.2.0/24 and the other two are 198.51.100.0/24 and 203.0.113.0/24.

              https://tools.ietf.org/html/rfc5737

              With all due respect, I would absolutely disagree. Say someone managed to get access to one of my machines remotely; knowing the IP ranges I use immediately narrows down the list of places they need to look for other servers. Granted it's not a massive risk, as the addresses are internal, but giving out internal addresses is unnecessary in this instance.

              Please substitute 192.0.1 for 182.16.1, and 192.0.2 for 18.16.2, if that helps.

              1 Reply Last reply Reply Quote 0
              • D
                derek_bartram
                last edited by

                Anyone? I sort of need to make this work…

                1 Reply Last reply Reply Quote 0
                • jahonixJ
                  jahonix
                  last edited by

                  @derek_bartram:

                  … managed to get access to one of my machines remotely; knowing the IP ranges I use ...

                  If I already conquered your network I have no problems looking around your broadcast domain to find further targets.

                  1 Reply Last reply Reply Quote 0
                  • DerelictD
                    Derelict LAYER 8 Netgate
                    last edited by

                    If you are already telling your users they need to go to :81 on the outside, split DNS will work the same from the inside.

                    Generally people run into problems with split DNS when they want a bunch of different addresses all listening on :80 to go to different ports on the inside like :80 to :8080, :80 to :8081, :80 to :8082, etc.

                    Chattanooga, Tennessee, USA
                    A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                    DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                    Do Not Chat For Help! NO_WAN_EGRESS(TM)

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

                      Dude if you don't want to post your rfc1918 space because your tin foil hat is squeezing the blood out your ears… then for gosh sake map it to some other rfc1918 space that your not using...  Because to be honest posting up some public space that is not yours and showing that as being on your lan networks makes you look like an idiot.. No offense..

                      Im with Derelict, how exactly is split dns not your solution since you have stated that you don't like nat reflection..  You show your servers listening on different ports... While the one that is using the standard port can be gotten too with your typical url http://some.name.tld your other one on 81 can not, no matter what you do inside or outside you would have to attach that :81 to your url so http://someother.name.tld:81 so how exactly is split dns not work for you?

                      Oh

                      I could do www.example.com:80 and hit server A, and www.example.com:81 and hit server B - both internally (LAN1/2) and externally.

                      Why would you do that… Why don't you just use different names??  host1.example.com, host2.example.com run a reverse proxy and send them to the correct place on your rfc1918 space on same default port 80.  Then internally resolve host1 and host2 to the respective rfc1918 IP.

                      Or if you don't want to use reverse proxy then use host1.example.com and host2.example.com:81

                      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
                      • C
                        cmb
                        last edited by

                        NAT reflection doesn't have a significant performance impact unless you're reflecting a huge number of connections. And if you had a consumer grade router that could handle it before, you definitely aren't.

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

                          But its still an abomination if you ask me ;)  And be it a huge performance hit doesn't change the fact that its not optimal, why send traffic through or even to my firewall/router that is just going to a box sitting next to me on my own lan..

                          I can not think of a reason where someone would say, yeah nat reflection is the best way to do this.. I see it as a work around for bad design choices sure.

                          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.