Skip to content

Linux: endpoint routes via default gateway override existing routes #1284

Closed

Description

@wojcik91

Description

This is a regression related to DefGuard/wireguard-rs#142

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

  1. added theissue type on Oct 23, 2026
  2. moved this to Development ready in Backlog & Roadmapon Oct 23, 2026
  3. added this to the 2.2.0 milestone on Oct 23, 2026
  4. self-assigned this
    on Oct 26, 2026
  5. moved this from Development ready to In Progress in Backlog & Roadmapon Oct 26, 2026
  6. moved this from In Progress to Review in Backlog & Roadmapon Oct 26, 2026
  7. moved this from Review to Testing in Backlog & Roadmapon Oct 28, 2026
  8. moved this from Testing to Ready to release in Backlog & Roadmapon Oct 29, 2026
  9. closed this as completedby moving to Ready to release in Backlog & Roadmapon Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions