You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Linux: endpoint routes via default gateway override existing routes #1284
configure_peer_routing on Linux calls configure_endpoints() for every peer that has an endpoint. For each one it installs <endpoint>/32 via <default gateway> using NLM_F_REPLACE in effect overwriting the pre-existing route for a given IP.
This breaks setups where one tunnel's endpoint is reachable only through another tunnel, because the secondary tunnel's gateway IP is incorrectly routed through the default gateway.
In 0.11.x Linux never added endpoint routes. BSD/macOS added them only when the peer's allowed IPs contained a default route.
The endpoint routes also don't appear to be removed when the interface is removed on Linux.
Proposed changes:
Linux: no endpoint routes. The fwmark rules from setup_default_route already stop WireGuard's own packets from looping.
Other platforms: add an endpoint route only when the peer's allowed IPs contain a default route, as in 0.11.x.
Never replace an existing route (use NLM_F_EXCL instead of NLM_F_REPLACE), and remove the endpoint routes on teardown.
Activity