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

WireGuard: DNS servers are implicitly routed through the VPN #1206

Closed
keeshux opened this issue Feb 21, 2025 · 2 comments · Fixed by #1207
Closed

WireGuard: DNS servers are implicitly routed through the VPN #1206

keeshux opened this issue Feb 21, 2025 · 2 comments · Fixed by #1207
Assignees
Labels
DNS regression Used to work but doesn't anymore WireGuard

Comments

@keeshux
Copy link
Member

keeshux commented Feb 21, 2025

Differently from v2, v3 adds manual routes to the DNS servers to the VPN settings. Beyond being unintended, this also breaks connectivity because WireGuard requires included routes to be present in AllowedIPs.

Reported here: https://www.reddit.com/r/passepartout/comments/1isz8xo/wg_config_with_registered_allowed_ip_does_not_work/

@keeshux keeshux added regression Used to work but doesn't anymore WireGuard DNS labels Feb 21, 2025
@keeshux keeshux added this to the Issues with split VPN and DNS milestone Feb 21, 2025
@keeshux
Copy link
Member Author

keeshux commented Feb 21, 2025

Removing the implicit routes is not enough. matchDomains = [""] is behaving differently in Passepartout and WireGuard as in Passepartout it's causing the DNS servers to be routed through the VPN no matter what.

As absurd as it sounds, this is caused by calling setTunnelNetworkSettings(nil) when the tunnel is started, to later call it with the actual settings. Dropping that call resolves the discrepancy.

@keeshux
Copy link
Member Author

keeshux commented Feb 22, 2025

The manual routes to DNS servers was introduced here:

#73
passepartoutvpn/tunnelkit@f799f47

Doubts:

  • If the DNS server is a private address inside the VPN, it should be reachable without a specific route
  • If the DNS server is a public address, and is pushed by the server, shouldn't the server push the route if it wants it to be routed through the VPN? The client doesn't know if the VPN is able to forward traffic to the Internet
  • If the DNS server is set by the client, then maybe it could make sense to add such routes to enforce routing through the VPN, yet it shouldn't be necessary

Check out OpenVPN source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DNS regression Used to work but doesn't anymore WireGuard
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant