-
Notifications
You must be signed in to change notification settings - Fork 333
Description
it's difficult to figure out whether a vpn is on and what vpn we're dealing with, so i'd like do discuss the situation a little.
the problems
macos
scutil --nc list
is the holy grail of figuring out what vpn is connected on macos, except that its very limited.
whilst tailscale and wireguard do show up, others like mullvad, private internet access, and openconnect do not, because only those vpns that were configured in the network settings are listed by scutil --nc list
.
as of right now i have found no other command to show vpn connections on macos.
besides, being connected to tailscale will always show a vpn connection, even if you're not routing your traffic via an exit node. this could lead to confusion and accidents where users think that they're safe, whilst they aren't. this issue has been taken care of in #279.
linux
here we check the network device tun0
. if it shows an IP address, we assume that you are connected via a vpn, otherwise you aren't. the issue is that not every vpn uses tun0
on linux, meaning that vpns like mullvad with their custom network device will never be detected.
possible solutions to discuss
macos
the only solution i've been able to come up with, is both untested and truly ugly.
some vpns have command line interfaces through with their connection status can be checked.
this means that we could
a) implement a custom check for every vpn we can test -> i wouldn't wanna do that
b) use an extra option and the eval statement that would allow users to inject their own code to manually check the vpn they use.
whilst i wouldn't wanna implement option a), i would for curiosity's sake at least want to try option b).
linux
so far i haven't thoroughly checked whether there are other commands to check for vpn connections, but the simplest option would be to create a list of network devices, that by default is only populated by tun0
, and the users can add whatever custom network device they need. this should allow for simple checking of relevant network devices and keep the general structure of our current approach.
please let me know what you think!