fix(network): prevent tunnel route from stealing local LAN on subnet overlap - #414
Closed
paul-kinexon wants to merge 1 commit into
Closed
fix(network): prevent tunnel route from stealing local LAN on subnet overlap#414paul-kinexon wants to merge 1 commit into
paul-kinexon wants to merge 1 commit into
Conversation
paul-kinexon
requested review from
miloschwartz and
oschwartz10612
as code owners
July 15, 2026 09:10
…overlap Set explicit Linux tunnel route metrics and prefer local connected routes when remote Pangolin subnets overlap the client's LAN.
paul-kinexon
force-pushed
the
fix/linux-overlap-route-metric
branch
from
July 15, 2026 09:16
967b75b to
498ab9c
Compare
Member
|
Hey @paul-kinexon thanks so much for the PR! We are actually going to move forward with the changes on 2bad244 and 6610655 but I appreciate the submission. We will be in touch about the updates. |
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.
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Problem
On Linux, when a client is on a local subnet that overlaps a remote Pangolin subnet (for example, both
10.200.4.0/23), the tunnel route added by OLM/newt can steal local LAN traffic. The tunnel route is added with implicit metric0, which beats the connected route on the physical interface (often metric100). Traffic to the local default gateway (for example10.200.4.1) is then sent via the tunnel interface instead of the LAN interface, breaking default routing.Root cause
LinuxAddRoute()added routes via netlink without settingPriority(metric).LinuxRemoveRoute()deleted routes by destination only, which is insufficient once multiple routes share the same prefix.Fix
50by default (NetworkManager VPN-style priority),1025when overlap with a local IPv4 subnet is detectedDst+LinkIndex+Priority, support IPv4/IPv6 route families, and accept an optional tunnel interface name to avoid deleting unrelated routesmacOS and Windows behavior is unchanged.
Notes / follow-ups
0are not removed by the new logicRemoveRoutes()now accepts an optional interface name; olm callers can pass their tunnel interface in a follow-up for safer removalHow to test?
make test10.200.4.0/23, gateway10.200.4.1, remote subnet10.200.4.0/23ip route get 10.200.4.1must use the local LAN interface, not the tunnelping 10.200.4.1, general internet access OK)