Timac / VPNStatus

VPNStatus, a replacement for macOS builtin VPN Status
https://blog.timac.org/2018/0719-vpnstatus/
MIT License
221 stars 31 forks source link

Auto-connect based on SSID #14

Closed javamon01 closed 2 years ago

javamon01 commented 2 years ago

Hi, this utility functions great as-is, but would it be possible to auto-connect only when outside of a given list of SSIDs? I.e.: The utility would accept a comma separated list of SSIDS and only auto-connect when not connected to that list.

I've found a few ways to do this on iOS through a vpn mobileconfig, but such a profile doesn't seem to work on the Mac.

Thanks!

Timac commented 2 years ago

Such a feature could most likely be built. VPNStatus could for example get the current SSID using:

CWInterface* wifi = [[CWWiFiClient sharedWiFiClient] interface];
NSLog(@"SSID: %@", wifi.ssid);

The current SSID could be compared to a given list of SSIDs to determine whether auto-connect should be enabled.

Timac commented 2 years ago

@javamon01 This feature is now implemented thanks to @cliss . You can find the version 1.2 with precompiled binaries here: https://github.com/Timac/VPNStatus/releases/tag/1.2

javamon01 commented 2 years ago

@javamon01 This feature is now implemented thanks to @cliss . You can find the version 1.2 with precompiled binaries here: https://github.com/Timac/VPNStatus/releases/tag/1.2

Thank you both! I appreciate the time and effort to make this work.

Olivier-Levasseur commented 4 days ago

Hi, I've found out how to don't autoconnect VPN for specific Wi-Fi SSIDs, but what about when using LAN? Is it possible to don't auto-connect VPN when you connect your Mac to a specific LAN? Because at home I usually use LAN connection and when I'm at home I don't need VPN to be active, since I use it only in remote (in Wifi).

Timac commented 4 days ago

Hi, I've found out how to don't autoconnect VPN for specific Wi-Fi SSIDs, but what about when using LAN? Is it possible to don't auto-connect VPN when you connect your Mac to a specific LAN? Because at home I usually use LAN connection and when I'm at home I don't need VPN to be active, since I use it only in remote (in Wifi).

@Olivier-Levasseur VPNStatus can detect if you are connected via Ethernet or if you are on a specific IP address. However, that would be a new feature request to be tracked in a different ticket.

Olivier-Levasseur commented 2 days ago

So how can you tell to VPNStatus to don't autoconnect if you are using a specific ethernet connection? I want to exclude the home ethernet other than the wifi home connection

Timac commented 2 days ago

So how can you tell to VPNStatus to don't autoconnect if you are using a specific ethernet connection? I want to exclude the home ethernet other than the wifi home connection

@Olivier-Levasseur This is possible but needs to be implemented. If I understand correctly, you want to detect when you are using Ethernet and it is on a specific external IP address?

Olivier-Levasseur commented 2 days ago

I basically need that VPNstatus doesn't autoconnect when I use ethernet of my home's internet line.