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

    NAT to non-local internal subnet?

    NAT
    3
    6
    3.5k
    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.
    • A
      aray
      last edited by

      Hi All,

      I'm trying to replace a cisco router with a pfsense router (latest stable, embedded).  Once hiccup i've noticed is that pfsense doesn't seem to be able to port forward (DNAT)  IP's that aren't locally (non-routed) accessible.

      EG.
      WAN 1.2.3.4  say I want to forward tcp port 8888 to 192.168.11.100 tcp port 80

      LAN: 192.168.0.1/24 (with a MPLS network routed via 192.168.0.100)  ….. 192.168.11.0 ..... 192.168.11.100

      I would be able to forward to 192.168.0.x fine, but not to anything routed past that point on the MPLS network.

      Any suggestions/work-arounds?  I googled a previous discussion list where someone said it could be done, but didn't describe how.

      Cheers,
      Andrew

      1 Reply Last reply Reply Quote 0
      • GruensFroeschliG
        GruensFroeschli
        last edited by

        What gateway does the netwok which is connected via MPLS have?
        Is the default gateway the same way back (via the pfSense)?
        If there is another default gateway, traffic gets NATd but the answer sent back directly
        (which wont work).

        For this you would have to enable source NAT
        –> traffic to the other side apears as if from the pfSense and thus make sure the answer goes back via the pfSense.

        We do what we must, because we can.

        Asking questions the smart way: http://www.catb.org/esr/faqs/smart-questions.html

        1 Reply Last reply Reply Quote 0
        • A
          aray
          last edited by

          The MPLS gateway is routed via 192.168.0.100 (so PFSENSE -> local net > MPLS gateway (this side has an interface on the local net) > MPLS network), and it isn't further natt'ed after pfsense has dealt with it.  The return path  from the MPLS is back via the same pfsense device (so it doesn't go out a different gateway, and pfsense should receive the packet and know it is related).

          I hate to ask a silly question - where can I find more information on how to do the source NAT'ing from pfsense? (how do I enable source nat)

          Cheers,
          A

          1 Reply Last reply Reply Quote 0
          • A
            aray
            last edited by

            After changing the interface to 'any' when setting up the nat we had success. Thank you for your time :) -

            Hopefully this post helps someone else in the future.

            1 Reply Last reply Reply Quote 0
            • GruensFroeschliG
              GruensFroeschli
              last edited by

              Umm.
              You shouldn't set that to any unless you know exactly what it does.
              Essentially anything that ever uses this port will now be redirected, even if is outbound traffic destined for the internet.

              Did you test this NAT forwarding rule from within your local LAN? Did you ever test from the outside?
              Because this
              http://doc.pfsense.org/index.php/Why_can%27t_I_access_forwarded_ports_on_my_WAN_IP_from_my_LAN/OPTx_networks%3F
              might be your problem.

              We do what we must, because we can.

              Asking questions the smart way: http://www.catb.org/esr/faqs/smart-questions.html

              1 Reply Last reply Reply Quote 0
              • jimpJ
                jimp Rebel Alliance Developer Netgate
                last edited by

                Did you add a static route on pfSense that told it 192.168.11.x is reachable via 192.168.0.100?

                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                Need help fast? Netgate Global Support!

                Do not Chat/PM for help!

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