Is it possible to determine the hostname or IP of a connected VPN server given one of Viscosity's utun interfaces?

Got a problem with Viscosity or need help? Ask here!

bribri

Posts: 15
Joined: Fri Jan 11, 2019 6:57 am

Post by bribri » Tue May 31, 2022 2:11 am
I'm a developer trying to work out the feasibility of an app idea, which is an app that can correlate a virtual interfaces (e.g. utun10) with a specific VPN connection, and then automatically set up routes based on which VPNs are connected.

Since I primarily use Viscosity to connect to my VPNs, I'd of course want this app to work with Viscosity. Is there any way for a third party app like this to figure out the hostname or IP address of the VPN server that's associated with a particular utun interface that Viscosity has set up?

One idea was to check Viscosity's logs, but it doesn't look like it saves its logs to disk anywhere. Is this correct?

(I understand if this is intentionally impossible in order to prevent third party apps from learning too much about a VPN connection.)

James

User avatar
Posts: 2312
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Tue May 31, 2022 1:26 pm
Hi bribri,

AppleScript can be used to get certain connection details. To get the associated interface you could potentially check which network has the same client IP address:
https://www.sparklabs.com/support/kb/ar ... cript-mac/

Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs

bribri

Posts: 15
Joined: Fri Jan 11, 2019 6:57 am

Post by bribri » Tue May 31, 2022 11:45 pm
Ah, I didn't think to check AppleScript. That should do the trick. Thanks!
3 posts Page 1 of 1