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

    Outbound NAT (hybrid) not working

    Scheduled Pinned Locked Moved NAT
    6 Posts 4 Posters 1.1k 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.
    • H
      hsv
      last edited by

      Hi
      I have 2 primary fiber connection with static IP and one backup over ADSL with DHCP

      I have them in a WAN loadbalancer where
      Fiber 1 (Tier 1)
      Fiber 2 (Tier 1) | WAN_GW
      Backup (Tier 2)/

      I have some traffic I will like to send out over backup line.
      I have made an outbound rule like this and the rule is placed first:
      Interface: Backup
      Source: 192.168.11.36
      Source Port: tcp/*
      Destination: "ip number"/32
      Destination port: tcp/25
      NAT Address: Backup address
      NAT Port: *

      If it make a telnet from the server 192.168.11.36
      telnet "ip number" 25
      The outbound rule do not pick up the traffic and it goes over the normal wan WAN_GW gateway, and not out over the Backup gateway.

      It I force the default gateway to use Backup then the traffic goes as it should.
      But not when I set the default Gateway to WAN_GW then it does not work, where the outbound rule should pickup the traffic and send it out over Backup line.

      What am I missing or do wronge?

      Regards
      Henning

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

        @hsv
        The traffic is sent out according to the routing table. An outbound NAT rule on its own does not change this behavior.

        If you want to direct traffic from certain IPs or a subnet or to certain destinations out to a specific gateway you have to policy route it. That means you have to create a firewall pass rule for the concerned source IPs and state the desired gateway in the advanced options. Put this rule to the top of the rule set so that it is applied before the allow-any rule.

        H J 2 Replies Last reply Reply Quote 1
        • H
          hsv @viragomann
          last edited by

          @viragomann
          Hi
          Thanks for the very fast respond, and it worked.

          Regards
          Henning

          1 Reply Last reply Reply Quote 0
          • J
            jrodrigomor @viragomann
            last edited by

            @viragomann said in Outbound NAT (hybrid) not working:

            If you want to direct traffic from certain IPs or a subnet or to certain destinations out to a specific gateway you have to policy route it. That means you have to create a firewall pass rule for the concerned source IPs and state the desired gateway in the advanced options. Put this rule to the top of the rule set so that it is applied before the allow-any rule.

            Hello @viragomann, i have the same problem with nat outbound in multi-wan, I've read the documentation and I have difficulty with this part of the explanation and cant' continue. Could you detail what the rule would look like or maybe even show me a print of this configuration?

            V johnpozJ 2 Replies Last reply Reply Quote 0
            • V
              viragomann @jrodrigomor
              last edited by

              @jrodrigomor
              As mentioned, this has nothing to do with outbound NAT. There is a NAT rule needed for outbound traffic on each WAN though, but pfSense adds this automatically, if you state a gateway on the WAN interface.

              What you need is called Policy Routing.

              It is just a firewall pass rule for allowing outbound, where you state a gateway in the advanced options. By using aliases for source or destination, you can limit the rule to certain devices or web resources.

              I don't have a policy routing rule in my configuration at this time, but if you search the web for this term, you will get a lot of hits with examples.

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

                @jrodrigomor said in Outbound NAT (hybrid) not working:

                Could you detail what the rule would look like or maybe even show me a print of this configuration?

                Here is an example, I have an outbound nat that says if you go out my ns1vpn, to nat to that address.. A rule that would force traffic out that gateway is placed on the interface where you have traffic you want to route out that gateway.

                policyroute.jpg

                You assign the specific gateway to a rule via the advanced when you setup the rule, notice the little gear next to the rule, that shows that an advanced setting was done on the rule.

                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 2
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.