Multiple exceptions for outgoing NAT



  • 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




  • @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.



  • @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.