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

    Bulk add SNAT rules for 1024 public WAN IPs (datacentre project)

    Scheduled Pinned Locked Moved NAT
    2 Posts 2 Posters 693 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.
    • T
      tilling
      last edited by

      Hi,

      Hope someone can help..

      I have 4 x /24 Public IP blocks (1024 addresses) which I have bound to pfsense as virtual server type any.

      I need to add a large number of SNAT rules to map a large number of SMTP servers to outbound public IPs, is there a way to add rules by script / command line?

      1 Reply Last reply
      Reply Quote 0
      • V
        viragomann
        last edited by

        To map whole subnets should be possible in pfSense outbound NAT.
        You can add a rule for a source subnet and at Translation select "Other subnet" from the bottom of the dropdown and enter your public subnet below.
        Maybe you also need to select "Bitmask" from the pool options.

        If you need special mappings defined in a translation table, there will also be a way to script it.
        Go to Diagnostics > Backup & Restore, select NAT at "backup area" and download the XML file. Open the file in a text editor and take a look at the rules to get an idea how they are constructed.
        This way you may build up your additional rules and insert them in the XML in the <outbound>section and import the file after in Diagnostics > Backup & Restore.</outbound>

        1 Reply Last reply
        Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
        Privacy Policy · Cookie Policy