OPNsense Forum

Archive => 18.7 Legacy Series => Topic started by: alex_rhys-hurn on September 23, 2018, 11:56:51 am

Title: [SOLVED] How does opnsense select gateway when OSPF
Post by: alex_rhys-hurn on September 23, 2018, 11:56:51 am
I have OSPF Running, and receiving a default route. OPNSense seems to prefer the gateways manually set in the gateways page.

What is the model by which opnsense selects gateways when dynamic routing is enabled?

Thanks,

Alex
Title: Re: How does opnsense select gateway when OSPF
Post by: mimugmail on September 23, 2018, 12:08:06 pm
Static routes have higher priority than OSPF learned routes. You have to disable them
Title: Re: How does opnsense select gateway when OSPF
Post by: alex_rhys-hurn on September 23, 2018, 04:54:24 pm
Hi,

Many thanks for your reply (and for the other on FRR).

Yes, I understand that route cost for static routes will always be lower than Dynamic routes.

So, are you saying that if I remove all the gateways and gateway settings from my interfaces, and then receive default routes by ospf then OPNSense will obey those?

I could then receive two OSPF Default routes (with different cost) and then do failover that way without all the policy based routing and dns malarky?

Can I make my gateway costs higher manually?

Many thanks,

Alex
Title: Re: How does opnsense select gateway when OSPF
Post by: mimugmail on September 23, 2018, 04:56:35 pm
Sure, in the end the failover code also just sets routes ... If you dont use them FRR will do the job.
Title: [SOLVED] How does opnsense select gateway when OSPF
Post by: alex_rhys-hurn on September 23, 2018, 05:12:27 pm
Thats totally awesome..... For me, really simplifies things.

Cheers,

Alex
Title: Re: How does opnsense select gateway when OSPF
Post by: fabian on September 23, 2018, 08:47:12 pm
Just to interrupt here:

Firewall rules can still overrule the routing table.
Title: Re: How does opnsense select gateway when OSPF
Post by: alex_rhys-hurn on September 23, 2018, 11:42:23 pm
Hi Fabian,

So, to answer my own question is the sequence for route selection something like this?

1st: Policy Based Routes via Firewall Rules
2nd: Static ROutes with cost lower than dymanic routes (I dont think you can modigy static route cost in the gui, which is a shame)
3: Dynamic Routing?

So given that I want to use dynamic routing as my primary default route path, I must be careful how things are configured.

Alex
Title: [SOLVED] Re: How does opnsense select gateway when OSPF
Post by: alex_rhys-hurn on October 02, 2018, 02:50:48 pm
I can confirm that deleteing all gateways, and setting gateway to auto in interfaces for my wan links, causes opnsense to use the OSPF injected default routes.

Failover between them is very fast, and it is load balancing via ECMP

Thanks,

Alex