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

Using NAT on BACKUP CARP

Scheduled Pinned Locked Moved HA/CARP/VIPs
6 Posts 3 Posters 581 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.
  • R
    rwfitzy
    last edited by Apr 4, 2025, 2:57 PM

    I would like to use a NAT rule on my BACKUP CARP router to allow trusted sources to connect to an iSCSI drive. This works on the MASTER, but can't connect through the BACKUP router. I did a packet capture and found the responses to the request are going through the MASTER.

    They both use the same network gateway of the data center so I'm assuming this is due to CARP? Or my Outbound NAT setup. I do not use a LAN per se, I have two public subnets with a hybrid NAT with NO NAT for those subnets with 4 interfaces...

    VIP -> 1.x.x.100/29
    WAN MASTER -> 1.x.x.101/29
    WAN BACKUP -> 1.x.x.102/29
    SYNC MASTER -> 2.x.x.251/24
    SYNC BACKUP -> 2.x.x.252/24
    SUBNET1 VIP -> 3.x.x.1/26
    SUBNET1 MASTER -> 3.x.x.2/26
    SUBNET1 BACKUP -> 3.x.x.3/26
    SUBNET2 VIP -> 4.x.x.1/27
    SUBNET2 MASTER -> 4.x.x.2/27
    SUBNET2 BACKUP -> 4.x.x.3/27

    My NAT rule is port forwarding 3260 to 1.x.x.20/26. How could I possibly send traffic using my NAT rule to respond directly back from the BACKUP router?

    V S 2 Replies Last reply Apr 4, 2025, 4:17 PM Reply Quote 0
    • V
      viragomann @rwfitzy
      last edited by Apr 4, 2025, 4:17 PM

      @rwfitzy
      Since you don't nat the upstream traffic from the inside networks, I assume, that these subnets are routed to one of your WAN IPs from outside, most probably to the CARP IP, which is occupied by the master, of course.
      So traffic to them logically go to the master.

      However, I don't understand, why your internal devices direct upstream traffic to the backup, but not to the CARP VIP and hence to the master.

      1 Reply Last reply Reply Quote 0
      • S
        SteveITS Galactic Empire @rwfitzy
        last edited by Apr 4, 2025, 5:02 PM

        @rwfitzy You're asking about incoming NAT rules/port forwards? Set the Dest. Address of the rule to the shared IP. Then it will work on both routers, whichever one is holding the shared IP.

        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
        Upvote 👍 helpful posts!

        1 Reply Last reply Reply Quote 0
        • R
          rwfitzy
          last edited by rwfitzy Apr 4, 2025, 5:59 PM Apr 4, 2025, 5:56 PM

          Yes, incoming NAT rule/port forward. When you say set to the shared IP, you mean the WAN CARP Virtual IP address? That doesn't seem to work either, same result.

          To be clear, I want this to work through the BACKUP router even when in CARP BACKUP mode. I had the NAT rule destination set to the WAN address thinking that is what's needed instead of the WAN CARP Virtual IP. When set to the WAN address, I see the traffic going back in the packet capture on the MASTER router...

          17:46:24.672688 IP 1.x.x.102.3260 > <remote ip>.56203: tcp 0

          On the BACKUP router, I see the traffic coming in ...

          17:46:24.885546 IP <remote ip>.56203 > 1.x.x.102.3260: tcp 0

          If I set the NAT rule destination to the WAN CARP Virtual IP address, I see the same incoming on the BACKUP packet capture with nothing on the MASTER packet capture.

          NOTE: I did make a mistake in my original post, the NAT port forward rule has a redirect target IP address of to 3.x.x.20/26 to SUBNET1. Also, the request is being done to 1.x.x.102, the WAN BACKUP real IP.

          S 1 Reply Last reply Apr 4, 2025, 6:20 PM Reply Quote 0
          • S
            SteveITS Galactic Empire @rwfitzy
            last edited by Apr 4, 2025, 6:20 PM

            @rwfitzy I think you'd need to use the backup router's WAN IP .102 in the NAT rule, and then set the backup router's SUBNET1 IP as the gateway on the .20 device.

            Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
            When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
            Upvote 👍 helpful posts!

            1 Reply Last reply Reply Quote 0
            • R
              rwfitzy
              last edited by Apr 4, 2025, 7:26 PM

              Thanks, yeah, makes sense, but using the gateway of SUBNET1 IP 3.x.x.3/26 on the .20 server disables access to the server all together. The route to the public SUBNET1 from the data center flows to the WAN Virtual IP address. Perhaps for these reasons, I am not able to do what I'd like. I'm looking for a way to pfSense to handle the responses when the server itself is always going to do that. The server is a TrueNAS server, perhaps I'll need see if there is a way to route back to the two different routers depending on which one it came from? There is a layer 3 switch between the two as well, maybe something there could help.

              1 Reply Last reply Reply Quote 0
              6 out of 6
              • First post
                6/6
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received