How to always be connected via VPN with no leaking

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

JoeBean

Posts: 1
Joined: Sun Mar 13, 2016 3:28 am

Post by JoeBean » Sun Mar 13, 2016 4:05 am
Hi all,
I've been running Viscosity on a Windows 10 PC for a couple of months and everything's been great, but I'd like to customize it's behavior a little and to that end I have a couple of questions.

I know it's possible to run a disconnect script to disable the local network adapter when the connection is dropped (such as outlined here), but is it possible to do something similar where traffic would be blocked to everything but the VPN server IP (as opposed to disabling the adapter) while Viscosity attempts to re-connect to the VPN? Or if not, is it possible to configure Viscosity to re-enable the adapter when attempting to re-connect so that I don't need to manually go and re-enable the adapter in Network settings? I tried adding a connect script that set the adapter to enabled but it still didn't connect, possibly because the adapter was re-negotiating an IP.

Also, is there an easy way to get Viscosity to start at login when it's set to run as administrator, as is required when using netsh?

Thanks for helping!

Eric

User avatar
Posts: 1146
Joined: Sun Jan 03, 2010 3:27 am

Post by Eric » Mon Mar 14, 2016 7:44 am
Hi JoeBean,

The short answer to blocking everything but a specific IP is no, not with Windows and scripting alone. You would need to use a firewall application or some description (Windows Firewall may allow you to do it) to block everything but a specific IP address.

In regards to bringing up the adapter via scripting, you will probably need to set a sleep or delay in the script that prevents the script from exiting (and Viscosity continuing to connect) until the adapter is up and has acquired DHCP. There has been some discussion about this on the forum in the past, doing a search should turn up some information if you're unsure on how to do this.

In regards to getting Viscosity to start as Admin, the simple answer is no, because you would be bypassing UAC to do so. You would need to start Viscosity as Admin yourself after logging in.

Regards,
Eric
Eric Thorpe
Viscosity Developer

Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs
2 posts Page 1 of 1