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

    NAT 1:1 on CARP VIP

    Scheduled Pinned Locked Moved NAT
    6 Posts 2 Posters 784 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.
    • A
      Ap0p0
      last edited by

      Hi all,

      I have a /28 WAN network and I have a HA cluster with 2 boxes. My NICs are as follow:

      for master and backup:
      WAN: x.x.x.201/28 and x.x.x.202/28 => VIP x.x.x.203/28
      LAN interface that I want to use: y.y.y.1/16 and y.y.y.2/16 ==> VIP y.y.y.3/16

      I need to use a public IP x.x.x.200 on a local device y.y.y.8

      I added a NAT 1:1 entry with:
      interface: WAN
      externat subnet IP: x.x.x.200
      internal IP: network y.y.y.8/32
      destination: any
      NAT reflection: none

      Then I added an IP alias on CARP WAN (x.x.x.203) with x.x.x.200/28

      After that, the CARP status shows both IPs 203 and 208 as master on box 1 and backup on box 2. It appears to be OK.

      Finaly, I added a firewal rule on WAN interface to allow any source/any protocol to x.x.x.200 (just to try)

      My local device y.y.y.8 have Internet access and source IP is OK (y.y.y.200). But when I try to simply ping x.x.x.200 from outside, I can see my requests on WAN interface, but nothing goes to my local device (firewall disabled on it).

      So, it appears I can only use x.x.x.200 from LAN o WAN and not from WAN to LAN.

      Is a pfSense guru can help me? :-) Where am I wrong?

      1 Reply Last reply Reply Quote 0
      • DerelictD
        Derelict LAYER 8 Netgate
        last edited by

        Finaly, I added a firewal rule on WAN interface to allow any source/any protocol to x.x.x.200 (just to try)

        Firewall rules for inbound traffic are processed after NAT occurs. That rule needs to pass traffic to the real address of the server, y.y.y.8.

        https://doc.pfsense.org/index.php/How_can_I_forward_ports_with_pfSense

        https://doc.pfsense.org/index.php/Port_Forward_Troubleshooting

        (I realize you are using 1:1 but almost all of the port forwarding principles still apply in that case.)

        Chattanooga, Tennessee, USA
        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
        Do Not Chat For Help! NO_WAN_EGRESS(TM)

        1 Reply Last reply Reply Quote 0
        • A
          Ap0p0
          last edited by

          Hi Derelict,

          thank you for you for your time!

          Ok, so my firewall rule must be: WAN interface, allow any source/any protocol to y.y.y.8 or something like this. I'll try this and come back here. I think I have to disable bogon rules so?

          You are saying I can do NAT port forwarding: like all port to x.x.x.200 forward to y.y.y.8? and specific SNAT rule for y.y.y.8 to x.x.x.200?

          1 Reply Last reply Reply Quote 0
          • A
            Ap0p0
            last edited by

            I just changed my firewall rule and it works!!!! thx!! :)

            1 Reply Last reply Reply Quote 0
            • DerelictD
              Derelict LAYER 8 Netgate
              last edited by

              You are saying I can do NAT port forwarding: like all port to x.x.x.200 forward to y.y.y.8? and specific SNAT rule for y.y.y.8 to x.x.x.200?

              1:1 NAT does both. Your problem was the rule wasn't passing the correct destination address because the rule needs to pass the post-NAT address.

              Chattanooga, Tennessee, USA
              A comprehensive network diagram is worth 10,000 words and 15 conference calls.
              DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
              Do Not Chat For Help! NO_WAN_EGRESS(TM)

              1 Reply Last reply Reply Quote 0
              • A
                Ap0p0
                last edited by

                Thank you mate!!!! yes, corrected firewall rule and works immediately as expected! :-)

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