Default gateway switching priority + policy routing to a down gateway
-
I have two multi-WAN questions.
-
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?
-
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.
-
-
https://doc.pfsense.org/index.php/Multi-WAN
has the answer to #1. For #2, I don't know.
-
#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.
-
@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.
#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.
-
Alright. So the next gateway to be used is chosen more-or-less randomly then?
-
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. :)
-
-
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.
-
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