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

    Default gateway switching priority + policy routing to a down gateway

    Scheduled Pinned Locked Moved Routing and Multi WAN
    6 Posts 4 Posters 2.0k 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.
    • T
      TechnoFairyGirl
      last edited by

      I have two multi-WAN questions.

      1. In a system with 3 or more gateways and "default gateway switching" enabled, if the default gateway goes down, what determines which of the remaining gateways is chosen to be the new default gateway? Is it possible to control this behavior?

      2. If I use a firewall rule to specify a gateway for certain traffic (policy-based routing), it seems the system will automatically go back to using the default gateway for that traffic if the gateway specified in the rule goes down. Is there any way to force pfSense to keep routing traffic to the gateway specified in the rule, even if it is down?

      Thank you.

      1 Reply Last reply Reply Quote 0
      • KOMK
        KOM
        last edited by

        https://doc.pfsense.org/index.php/Multi-WAN

        has the answer to #1.  For #2, I don't know.

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

          #1 No. It might even choose a gateway that is an inside router or something and not an internet gateway at all, breaking everything.

          #2 Routing traffic to a down gateway seems illogical. If you mean prevent it from going out WAN when the gateway is down, search "NO_WAN_EGRESS" for one way to prevent that.

          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
          • T
            TechnoFairyGirl
            last edited by

            @KOM:

            https://doc.pfsense.org/index.php/Multi-WAN

            has the answer to #1.  For #2, I don't know.

            That page has a lot of good information about setting up gateway groups, but as far as I can tell, default gateway switching is only mentioned in passing on that page and no details are given.

            @Derelict:

            #1 No. It might even choose a gateway that is an inside router or something and not an internet gateway at all, breaking everything.

            #2 Routing traffic to a down gateway seems illogical. If you mean prevent it from going out WAN when the gateway is down, search "NO_WAN_EGRESS" for one way to prevent that.

            1. Alright. So the next gateway to be used is chosen more-or-less randomly then?

            2. I had already considered the tag-on-ingress, block-on-egress approach as a possible solution. I was just wondering if there was a more direct "seriously, just follow my policy routing no matter what" option somewhere.

            Thanks both of you for the replies. :)

            1 Reply Last reply Reply Quote 0
            • luckman212L
              luckman212 LAYER 8
              last edited by

              I submitted PR#3609 that adds a feature to allow specific gateways to be omitted from being chosen during default gateway switching. Check it out if you're interested.

              1 Reply Last reply Reply Quote 0
              • luckman212L
                luckman212 LAYER 8
                last edited by

                Sorry for not being more specific in my last comment, but that PR#3609 is only for 2.4. In case anyone needs it, I made a version that applies clean to 2.3.3- you can grab it from this commit (apply in System Patches)

                https://github.com/luckman212/pfsense/commit/87d5f6579223410c629eddf5ca4386cb435e0a9e

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