Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system: switch default gateway by optionally selected group #2279

Closed
mimugmail opened this issue Mar 21, 2018 · 70 comments
Closed

system: switch default gateway by optionally selected group #2279

mimugmail opened this issue Mar 21, 2018 · 70 comments
Assignees
Labels
feature Adding new functionality
Milestone

Comments

@mimugmail
Copy link
Member

Hi,

is it possible to set a metric in routes or better in gateway config?
The problems is when you have more than 2 lines you can not set an order which line follows after primary down (with gateway switching).

With Cisco you can set as many default gateways and use metrics to set the priority.

Is this also possible with FreeBSD / OPN?

@fichtner
Copy link
Member

I think route metrics are not in FreeBSD #123

@mimugmail
Copy link
Member Author

Hm, OK, Not used by recent kernels. In Gateway - Advanced you can set a priority, would it be possible to patch the Script for adding routes to respect this setting?

@fichtner
Copy link
Member

fichtner commented Apr 1, 2018

@mimugmail what exactly do you mean?

@fichtner fichtner added the support Community support label Apr 1, 2018
@mimugmail
Copy link
Member Author

Via Advanced in gateways you can set a priority. When you have 3 you can set them 1 to 3 and when failover occurs, the script changing the routes could (if possible) check if the gateway which is down is a lower number, and if yes is there another gateway with a lower number, then use this as next default gateway, if not, self default gateway.

@fichtner
Copy link
Member

fichtner commented Apr 1, 2018 via email

@mimugmail
Copy link
Member Author

Oh, weight, correct. But that doesn't matter since in setups were weight is activly used, you don't care which default gateway the system has. But when you have a 1G, a 100M and a LTE line you don't want to see the firewall switch from 1G to LTE. Sure, the default gw is highest and there can only be one at a time. But it would be good to have a choice :)

In the long term (20.1, 20.7) I'd love to see the way Cisco does this with monitoring groups and tracked interfaces. 👍

@fichtner
Copy link
Member

fichtner commented Apr 2, 2018

Okay, i think we’re on the same page then. 😊

@fichtner fichtner self-assigned this Apr 2, 2018
@fichtner fichtner added feature Adding new functionality and removed support Community support labels Apr 2, 2018
@fichtner fichtner modified the milestones: 18.1, 18.7 Apr 2, 2018
@fichtner fichtner changed the title set metrics/ad in routes system: influence default gateway switching order by weight Apr 2, 2018
@fichtner fichtner modified the milestones: 18.7, 19.1 Jun 23, 2018
@mimugmail
Copy link
Member Author

@AdSchellevis this was the topic we talked via IRC lately :)

@AdSchellevis
Copy link
Member

@mimugmail ok, to summarize what we've discussed (if I remember correctly).

If @fichtner agrees, we could add a marker for "backup default" with a weight and use the weights to sort the gateways. This would allow us to prioritise default gateway switching. Ideally we would like to use policy based routing for local traffic too, but that is more of a long run solution. agreed? (if so, I'm offering todo the work for this item)

@fichtner
Copy link
Member

yes, but I want to see how da4d25e629 works out on 18.7... it's preliminary work to exclude certain gateways from default gateway switching. it's not practical to mark a gateway down and should probably be a separate option, but if this separate option is what we talk about here with a priority setting that would be best.

@fichtner
Copy link
Member

(it's correct to exclude down gateways from switching, I just mean it's impractical if you don't want it down and still not use it for default switching)

@mimugmail
Copy link
Member Author

mimugmail commented Jul 30, 2018

Full agree with this! :) (also with fichtner comments couple of sec's ago)

Just to have it here: The need for local PBR traffic would cover all transparent stuff like Squid, siproxd, ftp-proxy etc.

Local PBR can be a mind/long term task :)

Thanks guys, very appreciated!

@fichtner fichtner removed their assignment Sep 13, 2018
@fichtner fichtner assigned fichtner and unassigned AdSchellevis Nov 19, 2018
@fichtner
Copy link
Member

fichtner commented Nov 24, 2018

  • Add gateway group selection for IPv4 and IPv6
  • Move gateway switching back to System: Settings: General (not deprecated, not part of firewall)
  • Validate IPv4 / IPv6 on gateway groups (no model property!)
  • Possibly move fixup_default_gateways() to routing setup
  • Pass down gateways in order for fixup_default_gatways() to use them only or any available one

@mimugmail
Copy link
Member Author

If you need root access to some Multi WAN systems, ping me <3

@fichtner
Copy link
Member

@mimugmail I'll let you know when to test. Still some things to figure out.

EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…(host route not created on first execution) and remove get_interface_gatewayXXX usage. for opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…erty could be set to 'dynamic') in Gateway class, for opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…gure(), (host route not created on first execution) and remove get_interface_gatewayXXX usage. for opnsense#2279"

This reverts commit 0c1f95b.
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…teway() with new class implementation, reverted previous patch (misread the target interface). for opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…ress twice in return_gateway_groups_array(), our gateway class already resolved the address. for opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…ace_gateway() are unused, ditch duplicate these duplicates. for opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…, since we keep the configured "interface", these need to be renamed. for opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…return a gateway with an address as default here. for opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…dition the way it is implemented now. for opnsense#2279

It is used by dhcp client to detect if a default route might be overwritten and it determines default gateway priority. Since I don't want to refactor the dhclient-script at the moment, we best keep the file, but remove the "default" detection.
So system_default_route() sets the file, which dhclient can pickup when a new gateway is propagated.
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
… Since it doesn't make much sense to send all traffic to localhost, we better exclude it to keep the previous behaviour. for opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…consider dpinger endpoints down if not yet available. This could lead to some unexpected gateway switches. for opnsense#2279

We might consider another status for "startup", although since we report loss and delay as "~" it should already be obvious that we don't know the status yet.
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…sentation on new/edit equal. Previously you could have a group, containing an item that didn't exist anymore (interface removed), in which case you needed to remove the group to be able to edit it. related to opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…rface" contains the configured value now, we should use "if".
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…p, which isn't used in our system. orgininally this came from pfsense/pfsense@ab1112d

Let's remove it while working on opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…ally, but since you can easily add them manually, we better start without these and only add the ones found in the /tmp/XX_router[XX] files. for opnsense#2279
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…y behaviour. Since gif/gre interfaces already write _router files, we should only add openvpn client gateways to mimic the way it wasbefore. Also skip disabled interfaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding new functionality
Development

No branches or pull requests

5 participants