Skip to content

ndisc: support multiple gateways for a single network

Summary

When adding routes learned though ndisc currently routes are de-duplicated based on target network and it's prefix length, but not the gateway address. This means when multiple routers announce the same network, only the first route learned through ndisc will get added to the list of routes.

This also checks if the gateway address differs. If the gateway address differs, it is being added to the route entries. The kernel will then pick an appropriate gateway.

Purpose

This is useful for Thread networks where multiple BRs route to the same Thread network. If one of these BRs go offline, fallback to a different router will be much quicker if all BRs are present.

Previously, when a BR went offline, it took the lifetime of that entry to got stale before a NetworkManager would accept the route with a different gateway. Only then the Thread network becomes accessible again.

Be aware that for quick fallback to work IPv6 reachability probe needs to be active. Typically Linux disables reachability probes on Linux machines which act as IPv6 gateway (when forwarding is enabled).

Checklist

Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:

  • the subject for all commits is concise and explicative
  • the message for all commits explains the reason for the change
  • the source is properly formatted
  • any relevant documentation is up to date
  • you have added unit tests if applicable
  • the NEWS file is updated when the change deserves to be mentioned, for example for new features, behavior changes, API deprecations, etc.

Merge request reports