Repository navigation
Reach a gateway on the LAN directly - #60
Merged
Merged
Conversation
The host route that keeps a tunnel's transport off the tunnels named the default router even when the gateway was on the uplink's own network (a VPN server on the LAN): the packets went to the router, and the answers, sent directly, might never match (seen on Windows: handshake done, then nothing). The route now goes through the interface when the interface's own route to the gateway has no router (`route get -ifscope` on macOS, `ip route get ... oif` on Linux); a failed lookup keeps the router. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GarageDeveloper
added a commit
that referenced
this pull request
Nov 19, 2026
The on-link check moves from every route through the uplink to the gateway host route, behind the hook macOS and Linux now share (#60). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The host route that keeps a tunnel's transport off the tunnels always went through the default router, even when the VPN server is on the uplink's own network (a server on the office or home LAN). The packets then go to the router instead of straight to the server, and the replies may never come back. We saw it on Windows during the port: handshake done, then nothing received.
The route now goes straight to the interface when the interface's own route to the gateway has no router:
route -n get -ifscope <if> <gw>has noGATEWAYflag.ip -4 route get <gw> oif <if>has novia.If the lookup fails, the router is kept. The route is removed the same way it was added: the uplink stored for the gateway, and the journal entry, name no router.
Tests:
gateway_on_the_link: parses real output from both commands.interop/service/run.sh(Linux, systemd, WireGuard) passes.🤖 Generated with Claude Code