LNK wrote:I have a similar question, but at the other end. On my VPN, the IP always starts with 10.xxxxx. How can I extract the first part of the string to test it? I've thought of things like Webparser, but you have to give it a front marker to start from, and I don't have one. I think I need something like 'start from position 1, go to the first . and take everything in-between".
Ivan - my "VPN on" and "VPN off" IP addresses are hugely different, not just different in the last set of numbers. I wonder if you are looking at the right thing? (but that could just be how your VPN works - I look at the local IP address I get assigned by the VPN software.).
It didn't quite work as they suggested (it dropped through to the blue section and never changed), but the substitution bit did work, so I just had to move things around a little.
Old topic but I thought this might be relevant. Tested with Cisco AnyConnect v4.x.
In the registry, a value changes when a VPN toggles between connected and disconnected. This is the MTU value found at:
HKLM\SYSTEM\ControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\<index#>
You need to find the index number (0000, 0001, 0002, etc) for the VNP adapter. In the attached picture, this shows it to be 0001. I have other systems were it is 0003 and 0004. Easy way to find is to start at the key above and search for VPN.
The value used is MTU. When the VPN is disconnected, this will equal 1500. When a VPN is connected, this will be less than 1500. Thus, a simple IfCondition check
when you're not using a vpn, your machine has a default IP address supplied by your provider so, it should not be difficult to retrieve it; once you know it, set it as the variable "DefaultIP"... et voila'!!
In my example it set a different image if the vpn is on or off and write the IP address as text, you may choose different options though...