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

    WAN Failover using 2 Gateways on the same subnet

    Scheduled Pinned Locked Moved Routing and Multi WAN
    17 Posts 3 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.
    • V
      vsmaldino
      last edited by vsmaldino

      Hello everyone,

      there seems to be a behavior in the gateway availability control mechanism (online/offline) that appears strange to me, and I would appreciate feedback from someone more experienced than myself.

      The situation is as follows:

      WAN: 192.168.1.209/24
      GW1: 192.168.1.211 (default GW), weight 5, monitor IP x.x.x.X (public IP from Google)
      GW2: 192.168.1.232, weight 8, monitor IP x.x.x.Y (public IP from Google)
      LBFO1: Gateway Group composed of GW1 + GW2 both layer 1, trigger level "Packet loss or High Latency"
      

      If GW1 goes offline, GW2 is also marked offline even though it is online. Obviously, the same situation occurs reversing the gateways.
      Is the first behavior normal, or am I doing something wrong?

      This behavior is present in all versions I've experimented with (currently 2.7.2), forcing me each time to add new WAN network interfaces (WAN1, WAN2, ...) and split the WAN subnet to associate each network interface with its gateway

      WAN1 192.168.1.209/27 -> GW1 192.168.1.211
      WAN2 192.168.1.230/27 -> GW2 192.168.1.232
      LBFO1: Gateway Group composed of GW1 + GW2 both layer 1, trigger level "Packet loss or High Latency"
      

      This way it works fine, if GW2 goes offline, GW1 is still online and the traffic routed on LBFO1 flows via GW1.

      Thank you.

      Vito Smaldino

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

        @vsmaldino said in WAN Failover using 2 Gateways on the same subnet:

        LBFO1: Gateway Group composed of GW1 + GW2 both layer 1, trigger level "Packet loss or High Latency"

        This does load balancing. In this case, the gateways have to be on different interfaces.
        See Load Balancing in the docs.

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

          @viragomann
          from Load Balancing
          " If a gateway that is part of a load balancing group fails, the interface is marked as down and removed from all groups until it recovers"
          Yes this is the answer, thank you.

          In any case, I don't understand why the entire interface is marked down if even just one of the gateways goes offline. I would have expected that only the offline gateway be excluded, and the traffic could still flow through the gateway that remains online.

          Bob.DigB V 2 Replies Last reply Reply Quote 0
          • Bob.DigB
            Bob.Dig LAYER 8 @vsmaldino
            last edited by

            @vsmaldino said in WAN Failover using 2 Gateways on the same subnet:

            In any case, I don't understand why the entire interface is marked down if even just one of the gateways goes offline.

            Probably a design decision we have to live with.

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

              @vsmaldino
              Yeah, load balancing gateways are somehow special in pfSense. In contrast to a failover gateway group, you also cannot use lb gw groups for policy routing.
              There might be reasons for this.

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

                @viragomann From my tests it is not a question of groups or types of groups (LB, FO or LB+FO)
                The real limitation is given by the close relationship between a gateway and the associated network interface. To define a gateway you must first of all indicate the network interface with which to use it. When the gateway goes down, its interface is marked as "down" regardless of whether there are other active gateways using it. From what I've seen from my testing, this happens even if you don't define any group.
                The best load balance and fail over system I've seen so far is the one implemented by the late Zeroshell by Fulvio Ricciardi.

                Bob.DigB 1 Reply Last reply Reply Quote 0
                • Bob.DigB
                  Bob.Dig LAYER 8 @vsmaldino
                  last edited by

                  @vsmaldino You can do it anyway, I have this running here:
                  Capture.PNG

                  V 1 Reply Last reply Reply Quote 1
                  • V
                    vsmaldino @Bob.Dig
                    last edited by

                    @Bob-Dig The problem is what happens if any of your SS_* GWs go down? According to my tests, they should all go down because they supposedly all use the same network interface. This behavior is not acceptable in my network.

                    Bob.DigB 1 Reply Last reply Reply Quote 0
                    • Bob.DigB
                      Bob.Dig LAYER 8 @vsmaldino
                      last edited by Bob.Dig

                      @vsmaldino said in WAN Failover using 2 Gateways on the same subnet:

                      The problem is what happens if any of your SS_* GWs go down?

                      There is no problem as long as there is no gateway set on the interface itself.

                      V 1 Reply Last reply Reply Quote 0
                      • V
                        vsmaldino @Bob.Dig
                        last edited by

                        @Bob-Dig what do you mean with "there is no gateways set on the interface"?
                        When creating a gateway you need to define an interface for its use. From your screenshot I assume that all SS_* have the same interface, according to my tests, if only one of the SS_* goes down, that interface is marked as down.
                        Am I doing something wrong?
                        f4c7d3c6-f1d2-4074-a700-f1b71afa392e-image.png

                        Bob.DigB 1 Reply Last reply Reply Quote 0
                        • Bob.DigB
                          Bob.Dig LAYER 8 @vsmaldino
                          last edited by Bob.Dig

                          @vsmaldino said in WAN Failover using 2 Gateways on the same subnet:

                          what do you mean with "there is no gateways set on the interface"?

                          Capture.PNG

                          Capture.PNG

                          V 1 Reply Last reply Reply Quote 0
                          • V
                            vsmaldino @Bob.Dig
                            last edited by

                            @Bob-Dig first of all, thank you for your patience.
                            Your screenshot refers to the IP configuration of the network interface, it doesn't set any upstream gateway, Ok.
                            But what about the config of the SS_* GWs? Can you send me a screenshot of a couple of them? I'm very curious to see which interface they use and if it is the same as I presumed.

                            Bob.DigB 1 Reply Last reply Reply Quote 0
                            • Bob.DigB
                              Bob.Dig LAYER 8 @vsmaldino
                              last edited by Bob.Dig

                              @vsmaldino said in WAN Failover using 2 Gateways on the same subnet:

                              But what about the config of the SS_* GWs? Can you send me a screenshot of a couple of them? I'm very curious to see which interface they use and if it is the same as I presumed.

                              It is the interface (192.168.111.1) I showed above.
                              Screenshot 2024-03-11 at 10-09-17 pfSense.aadf.de - System Routing Gateways Edit.png
                              If you have to NAT, you have to create the NAT-Rules manually. I don't because all the gateways are OpenWrt-VMs.

                              V 1 Reply Last reply Reply Quote 0
                              • V
                                vsmaldino @Bob.Dig
                                last edited by

                                @Bob-Dig
                                Tnx, another step over ;-)
                                VLAN111_OWRT_LAN is the interface of Ss_DeBe Gw.
                                I presume these:

                                1. Ss_AtVie, Ss_ChZur, ... have the same VLAN111_OWRT_LAN interface
                                2. 192.168.111.1 is the IP address of VLAN111_OWRT_LAN

                                Is it right?

                                Bob.DigB 1 Reply Last reply Reply Quote 0
                                • Bob.DigB
                                  Bob.Dig LAYER 8 @vsmaldino
                                  last edited by

                                  @vsmaldino correct.

                                  V 1 Reply Last reply Reply Quote 0
                                  • V
                                    vsmaldino @Bob.Dig
                                    last edited by

                                    @Bob-Dig
                                    Tnx. It is a scenario very similar to that i tested with.

                                    These are my GWs, both on the same interface, NO Gateway Groups defined.
                                    fd163840-0f3f-437e-9a48-6e43c36d8918-image.png

                                    This is the status few seconds after shutting down only FibraITG:
                                    82b6f14e-f256-40f2-a036-a2776a63638e-image.png

                                    In few tens of seconds both GWs are marked down, i think because both use the same interface (WAN).

                                    As you stated on March 7, there is some deep design decision that put in close relationship the status of the gateways using the same interface.

                                    Bob.DigB 1 Reply Last reply Reply Quote 0
                                    • Bob.DigB
                                      Bob.Dig LAYER 8 @vsmaldino
                                      last edited by

                                      @vsmaldino True. But also you have a gateway set on WAN.
                                      My setup is also different that I don't use WAN for those VPN-Gateways on the same interface and none of those gateways is the default gateway.

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