Nowadays NetworkManager can do per-device and per-af connectivity checking (if enabled, see bug 1437608).
If a device has no global connectivity, then the device's default-route (/0 prefix length) for that address family gets a penalty of +20000 to the metric.
The example usecase is when your phone is connected to mobile network, and then you connect to a Wi-Fi network that is behind a captive portal. At first, there is no connectivity on Wi-Fi, and the default-route there gets bumped so that mobile internet is still preferred. Once you login to the captive portal, the default-metric gets the original value and is now preferred over mobile network.
Also, with bug 1714438, we can add a default-route like any other static, manual route.
Currently, we add the penalty to every /0 route. I think that is not always desirable. It should be configurable whether a device's default-route is subject to such behavior. Also, for default-routes configured as manual routes, the user should be able to opt-out from this. Also, maybe regular routes should get the same treatment.
TODO: make it more configurable of whether a route gets the penalty or not.
- add the possiblity that non-default (!= /0) routes the the penalty too
- add a way to opt-out for default-routes to get the penalty (or maybe even disable it for manual routes altogether).
currently there are no resources to work on this.
Also, in RHEL connectivity-check is commonly not done.
Also, connectivity-check is supposed to do something simple -- for simple use-cases like on a note-book. It may not be fully flexibile/configurable, and that is fine.
Maybe in the future.