Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Setup for allowing multiple IP subnets on a NAT entry

    Scheduled Pinned Locked Moved Firewalling
    4 Posts 2 Posters 850 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.
    • J Offline
      jptechnical
      last edited by

      Hi all, by way of introduction I have been using pfSense since it first came out and m0n0wall long before this time, I have a few firewalls in service for over a decade with regular updates and hardware swap as needed. I have never needed help on something, and now I find my eyes are crossing trying to wrap my meager brain around how to do this… it should be easy.

      NAT Port forward for port 80, going to 192.168.20.14

      Allow the following subnets:
      204.155.60.*
      204.155.61.*
      204.155.62.*

      Allow the following IPs:
      12.70.106.33
      12.70.106.34
      173.210.80.242

      How do I add all those ip blocks and individual IPs? Have pity on me ;-)

      JP
      screenshot_90.png
      screenshot_90.png_thumb
      screenshot_91.png
      screenshot_91.png_thumb

      1 Reply Last reply Reply Quote 0
      • V Offline
        vindenesen
        last edited by

        First, create an alias containing the subnets that should be allowed. And then use that alias in the source section of the NAT rule.
        This will restrict the NAT to only apply when the source is in your alias.

        The alias would then contain these networks:

        204.155.60.0/24
        204.155.61.0/24
        204.155.62.0/24
        12.70.106.33/32
        12.70.106.34/32
        173.210.80.242/32

        Support the project by buying a Gold Subscription at https://portal.pfsense.org
        Running pfSense on SuperMicro A1SRI-2758F with ESXi 5.5

        1 Reply Last reply Reply Quote 0
        • J Offline
          jptechnical
          last edited by

          Oh my goodness… it is soooo simple, ALIAS! Thanks a ton!

          One more question, which is the best way to express an entire subnet? The help text says you can either do 1.1.1.1-1.1.1.255 and /32 or 1.1.1.1 /24 to express the entire 1.1.1.* Which is the preferred method to allow access from the entire subnet? I would assume /24 would be preferable to writing it out since /24 is 255.255.255.0 which accomplishes what I want?

          Thanks a TON for your quick response!

          JP

          @vindenesen:

          First, create an alias containing the subnets that should be allowed. And then use that alias in the source section of the NAT rule.
          This will restrict the NAT to only apply when the source is in your alias.

          The alias would then contain these networks:

          204.155.60.0/24
          204.155.61.0/24
          204.155.62.0/24
          12.70.106.33/32
          12.70.106.34/32
          173.210.80.242/32

          1 Reply Last reply Reply Quote 0
          • V Offline
            vindenesen
            last edited by

            I personally prefer using a.b.c.d/24, but that's just me. I think it's easier to read, and to see that it actually applies to the entire subnet.

            Support the project by buying a Gold Subscription at https://portal.pfsense.org
            Running pfSense on SuperMicro A1SRI-2758F with ESXi 5.5

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