From the command line, how to tell if a particular VPN connection is up

command lineNetworkvpn

Suppose that I have multiple VPN connections configured in System Preferences/Network.

How do I tell if a particular one (identified by the service name in System Preferences/Network) is up, on the command line in OS X Mavericks?

Best Answer

If you know the network address range, you could use "ifconfig" and parse the output to see if an interface is up and running with an IP in the appropriate range.