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

    1:1 NAT for an entire subnet - am I understanding this correctly?

    Scheduled Pinned Locked Moved NAT
    7 Posts 3 Posters 1.9k 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.
    • S
      sforsythe
      last edited by

      So our company has just moved to pfsense to replace Dell branded SonicWalls.
      We are new to pfsense/*bsd and have hit a stumbling block.

      We have (2x)  /24 networks (for redundancy) and (1x) /22 network ….

      If we want the IP Addresses to be pingable and use 1:1 NAT ... we have to manually create an IP Alias for each and every ip address in the subnet?  That seems crazy!

      In other firewalls I have used (not just Sonicwall) .. you can say something like
          AAA.BBB.CCC.0/24 -> 10.10.1.0/24

      For Sonicwall at least, that is almost literally the default option, take the WAN subnet and if same class as LAN subnet, make rule to NAT.

      If we were so inclined to manually create rules for our 3 networks, that would be : 253 + 253 + 1012 = 1,518 virtual IPs

      Can the pfsense software/gui scale that big? We are using 2 SG-8860 for H.A.

      Thanks for any help or suggestions how to tackle.

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

        Why not just put the public subnets on pfSense interfaces and stop NAT entirely?

        Need more information about the subnets and what's routed to where.

        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

          I can understand the 1:1 NAT in the case of say a site to site vpn where one site is using the same network space as you, etc.

          And even then the better plan in that would be to renumber 1 side.  I don't understand why anyone in their own network would want to 1:1 nat a whole subnet to be honest..

          I am with Derelict here - I think way more information is needed.

          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
          • S
            sforsythe
            last edited by

            We have an IP space given to us by our provider,  AAA.BBB.CCC.0/24

            AAA.BBB.CCC.1 is the upstream provider router/gw. The whole subnet is routed to it and sent to us through its port.
            Our firewall (for legacy reasons) WAN is AAA.BBB.CCC.4  , our LAN is 10.10.1.0/24

            While not the full 250+ ip address, for various clients/purpose we have fairly close to at least 80-100+ unique IPs (webservers, mail, ftp,etc) on the LAN that use the 1:1 nat to be publically addressable.

            I'm not sure I understand what you mean by

            Why not just put the public subnets on pfSense interfaces and stop NAT entirely?

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

              Your network AAA.BBB.CCC.0/24 should be ROUTED to you via a transit network. Not just hung off your isp equipment - where you point to AAA.BBB.CCC.1 as your gateway.

              This way you put that /24 behind pfsense and just have to firewall the connections to it - no nat, not port forwarding, etc.

              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
              • DerelictD
                Derelict LAYER 8 Netgate
                last edited by

                Just to be clear your WAN port has a /24 netmask right?

                What is this about another /24 and a /22?

                johnpoz is describing something like this:

                Have your provider assign you something like a /29

                Network: 8.6.5.0
                Gateway: 8.6.5.1
                YOUR WAN: 8.6.5.4
                Netmask: 255.255.255.248

                Then your provider routes aaa.bbb.ccc.0/24 to 8.6.5.4

                You configure OPT1

                Network: aaa.bbb.ccc.0
                OPT1 Address: aaa.bbb.ccc.1
                Netmask 255.255.255.0

                Then you give your servers aaa.bbb.cc.2, aaa.bbb.ccc.3 etc.

                Disable outbound NAT on WAN for aaa.bbb.ccc.0/24.

                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
                • S
                  sforsythe
                  last edited by

                  Just to be clear your WAN port has a /24 netmask right?

                  What is this about another /24 and a /22?

                  You can disregard that, yes our WAN has a /24 
                  … the other /24 and /22 are separate networks from another provider (which will be handled by separate hardware)

                  Thanks for your description, that makes it a lot clearer.  Will work with provider and see if they can provide something similar.

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