macOS: ignore on-link default routes when picking the physical uplink #18

Merged
sneak merged 1 commits from macos-onlink-default-route into next 2026-11-07 05:23:31 +01:00
1 Commits
Author SHA1 Message Date
sneak 6dc3b9e395 macOS: ignore on-link default routes when picking the physical uplink
check / check (push) Successful in 2m32s
A VM with NAT networking makes vmnet install a default route scoped to
its bridge (bridge100) with no gateway. The detector counted it as a
second physical default route and refused to start:

    multiple physical default-route interfaces found (bridge100, en0)

Scoped routes cannot simply be dropped: while a VPN holds the default
route, the physical interface keeps only a default route scoped to
itself. That route still names its gateway (flag G). The on-link one
does not, so a physical default route now requires a next-hop gateway.

parseNetstat records a gateway only when the G flag is set; a link#N
gateway column is the interface itself, not a next hop.
2026-11-06 19:08:12 -08:00