VNet route conflict diag: Handle changes to interface index#56936
Draft
VNet route conflict diag: Handle changes to interface index#56936
Conversation
ravicious
commented
Jul 18, 2025
df665c1 to
7df18bd
Compare
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 problem
One of the customers shared a video showing a problem with VNet. Throughout the video, a VPN software that's running on the device seems to be constantly reconnecting. At one point in the video, the VNet diag report shows this:
It means that the diag check classified 4.0.0.0/6 and 8.0.0.0/5 as route destinations belonging to VNet's utun5 interface. However, the report also clearly shows that VNet uses 100.64.0.0/10 as its IPv4 CIDR range. This means that it'd never set up routes like 4.0.0.0/6 (the routes are set up in
lib/vnet/osconfig_darwin.go).The way that the diag check collects the route destinations is as follows:
The only explanation for the behavior from the video that we can think of is the index of VNet's interface suddenly changing. I don' know how this could happen, all I could find on the internet was a single SO question where someone mentions a similar problem. We suspect it might had to do with the VPN software constantly reconnecting and rebuilding its network interface, but I wasn't able to reproduce this with Tailscale for example. The VPN software the customer uses must be doing something extra.
The fix
In the current version of VNet, there are two situations where this mismatch could theoretically happen:
vnet_configresource of each root cluster.