Windows: management dial stuck on metric-preferred NIC with no upstream (no interface fallback) #7045
Unanswered
siraykut
asked this question in
Issue Triage
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the problem
On Windows with advanced routing (
IP_UNICAST_IF), the client binds management/signal gRPC dials to the metric-preferred interface from the routing table. If that NIC is up and has a default route but no working upstream connectivity, dials time out and NetBird never falls back to another interface that can reach the management server.User-context HTTPS to the same host can succeed (Windows chooses a working path), while the NetBird service (
LocalSystem) fails with:To Reproduce
172.20.10.0/28): higher metric, can reach management over HTTPS:443netbird upnetbird statusstaysManagement: DisconnectedExpected Behavior
Management dial should succeed via a working interface (Wi-Fi in this case), even if a lower-metric NIC has a non-working default route.
Are you using NetBird Cloud?
No — self-hosted (
netbird.planatechnologies.io).NetBird version
0.76.1(windows/amd64)Evidence / findings
Test-NetConnection mgmt:443(user)Invoke-WebRequest https://mgmt(user)curl --interface <wifi-ip> https://mgmtcurl --interface <ethernet-ip> https://mgmtnbnet.NewDialer()i/o timeout~20s, then canceledWorkaround that immediately fixed it:
After that: Management/Signal Connected, peers 4/4.
Relevant code path
client/grpc/dialer_generic.go→nbnet.NewDialer().DialContextclient/net/dialer_init_windows.go→Control = applyUnicastIFToSocketclient/net/net_windows.go→selectInterface/GetBestInterfaceFuncclient/internal/routemanager/systemops/systemops_windows.go→GetBestInterfacereturns only the first sorted candidateProposed fix
I will open a PR with this approach.
All reactions