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

    NAT to different interface than WAN

    Scheduled Pinned Locked Moved NAT
    7 Posts 2 Posters 359 Views 3 Watching
    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.
    • P Offline
      Pagi
      last edited by

      Hello,

      My router looks like below:

      WAN IP: x.x.x.102 (Public)
      LAN1 IP: 192.168.0.1
      LAN2 IP: 192.168.10.1
      LAN3 IP: y.y.y.81 (Public)

      Now NAT is configured to exit with IP x.x.x.102 on WAN interface.
      Is it posible to configure like this:

      Leave LAN1 to use x.x.x.102 on WAN interface to NAT outside.
      Reconfigure PFsense to NAT LAN2 through y.y.y.81 configured on LAN3 interface.

      Network on LAN 3 is different than this configured as WAN.

      When I configure NAT outbound rule for 192.168.10.0/24 to use y.y.y.81 as addess in Translation section leaving WAN as interface the hosts from 192.168.10.0/24 are still visible in internet as x.x.x.102

      When I change interface to LAN3 in NAT outboun rule it stop works at all.

      Is it possible to configure it somehow?

      BR
      Pawel

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        SteveITS Rebel Alliance @Pagi
        last edited by

        @Pagi Does LAN3 have a gateway? The labeling confuses me a bit.

        If LAN3 goes towards the Internet then the interface in the outbound NAT rule would be LAN3. It might be clearer to label it WAN2 though.

        However per https://docs.netgate.com/pfsense/en/latest/multiwan/nat.html it should be automatic?

        "The default NAT rules generated by pfSense® software will translate any traffic leaving a WAN-type interface to the IP address of that interface. ... This is all handled automatically unless Manual Outbound NAT is enabled."

        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 reboot, or more depending on packages, and device or disk speed.
        Upvote 👍 helpful posts!

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          Pagi @SteveITS
          last edited by Pagi

          LAN3 is a LAN interface because this is a different public network /28 routed to my router to his WAN IP x.x.x.102. This network is y.y.y.80/28 where y.y.y.81 is gateway for this network but from LAN3 side. In my understanding this is LAN network but with public IPs. It's not connected directly to the internet link. It's on the oposite side of the router, but is accesible from the internet as the second public IP of the router but on the different interface than WAN.
          I hope that I can explain it as much clearly as I can :)

          Ind the question is.. do I use IP of this "inside" interface as NAT source to the internet for 192.168.10.0/24 network whis is connected to another LAN interface.

          When I try to setup it as on the screen any of the internet IPs are not pingable. Rules for LAN 2 and LAN 3 allowa any outgoing traffic.

          nat1.jpg

          Is any chance to make it working?

          Maybe this diagram explain more:

          schamatpfsense.jpg

          Best regards and sorry for my not very fluent English :)
          Paweł

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            SteveITS Rebel Alliance @Pagi
            last edited by

            @Pagi Ah, I see. Public IPs used internally normally do not use NAT:
            https://docs.netgate.com/pfsense/en/latest/recipes/route-public-ip-addresses.html#nat-configuration. The remote end connects to the public IP directly, and access is controlled by firewall rules on WAN.

            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 reboot, or more depending on packages, and device or disk speed.
            Upvote 👍 helpful posts!

            P 1 Reply Last reply Reply Quote 0
            • P Offline
              Pagi @SteveITS
              last edited by

              @SteveITS said in NAT to different interface than WAN:

              @Pagi Ah, I see. Public IPs used internally normally do not use NAT:
              https://docs.netgate.com/pfsense/en/latest/recipes/route-public-ip-addresses.html#nat-configuration. The remote end connects to the public IP directly, and access is controlled by firewall rules on WAN.

              Yes, i know this. Hosts from y.y.y.80/28 can directly reach internet through routing (without NATing of course). I have no NAT outbound rules for public network.

              The case is to use the second public IP of the router from LAN3 interface to NAT through it hosts from LAN2 network (192.168.10.0/24).
              Please see my diagram :)

              I want a situation that:
              192.168.0.0/24 is NATed through x.x.x.102
              192.168.10.0/24 is NATed through y.y.y.81
              y.y.y.80/28 is routed without NAT

              I'm preety sure that i dit it a long time ago on linux.

              BR
              Pawel

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                SteveITS Rebel Alliance @Pagi
                last edited by

                @Pagi Can .81 be split out into a /30 maybe? Then the remainder can be on LAN3.

                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 reboot, or more depending on packages, and device or disk speed.
                Upvote 👍 helpful posts!

                P 1 Reply Last reply Reply Quote 0
                • P Offline
                  Pagi @SteveITS
                  last edited by Pagi

                  @SteveITS I don't want to do this. I think that is not good option to loose public IPs for that purpose :/ Furthermore y.y.y.80/28 is already assigned and ~80% IPs are used.

                  So it's not possible to do NAT using "internal" public IP?

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