I want to see if my mac is connected to VPN
What high-level goal are you trying to achieve by detecting whether the “mac is connected to VPN”?
The reason this matters is that VPN’s are ridiculously complicated on our platforms. macOS VPNs come in three flavours:
And packet tunnels can be based on the destination IP address or the source app (another type of per-app VPN). And destination IP address packet tunnels can provide the default route or be limited to a specific set of destination networks.
Moreover, it’s possible to have multiple different layers of VPN running! And folks can use technologies that are not strictly dedicated to VPN, like a transparent proxy, as a VPN.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"