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

    Multiple exceptions for outgoing NAT

    Scheduled Pinned Locked Moved NAT
    3 Posts 2 Posters 534 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.
    • D
      der.helge
      last edited by

      Hello everybody,

      I would like to exclude multiple IP subnets from my outgoing NAT rules but I
      don't know how.

      I understand that it is not directly possible, as shown in the picture
      outgoingNAT.png. But is there a way to exclude multiple networks from NAT?
      I thought to configure multiple rules, each with an IP network as an
      exception. However, this cannot work because the first rule would match for
      IP networks that are excluded in the following rules:
      1. NAT for everything except 192.168.0.0/16
      2. NAT for everything except 172.12.0.0/12
      3. NAT for everything except 10.0.0.0.0/8

      A packet from 10.0.0.1 would match in the first rule. But it should actually
      be excluded from the NAT process.

      Does anyone have an idea how to solve this problem?

      Cheers,
      Helge

      outgoingNAT.PNG
      outgoingNAT.PNG_thumb

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

        @der.helge:

        I would like to exclude multiple IP subnets from my outgoing NAT rules but I
        don't know how.

        Destination subnet, as your screenshot shows?

        @der.helge:

        I understand that it is not directly possible, as shown in the picture
        outgoingNAT.png. But is there a way to exclude multiple networks from NAT?

        Just put all your the subnets into an alias (Firewall > Aliases).
        Add an outbound NAT rule for the corresponding interface, check "Do not NAT", at destination select Network and enter the alias name.
        Put this NAT rule to the top of the rule set. Now outbound NAT is disabled for the subnets contained in the alias.

        1 Reply Last reply Reply Quote 0
        • D
          der.helge
          last edited by

          @viragomann:

          Just put all your the subnets into an alias (Firewall > Aliases).
          Add an outbound NAT rule for the corresponding interface, check "Do not NAT", at destination select Network and enter the alias name.
          Put this NAT rule to the top of the rule set. Now outbound NAT is disabled for the subnets contained in the alias.

          That's the trick… Thank you very much. Works great.

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