-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-disconnect OpenVPN when a physical connection to the corporate network is established #639
Comments
I had thought of implementing such a feature but I haven't found a reliable method to detect "trusted networks". Any form of auto-disable comes with a risk. The easiest may be to specify a list of DNS suffixes but that's not really fool-proof. You may end up having your VPN disabled in an insecure network. |
The Solution is very Simple. You just need to determine in which cases your connection should established
I wrote this script that will run every minute with the Windows scheduler:
Would be easier if someone would integrate it into the code from openvpn-gui! Thanks |
As I mentioned, the issue is not "ease of implementation" but lack of a secure method of detecting networks. If that script works for you continue using it. I cannot integrate such a solution as its not safe enough in my opinion. Its easy to spoof MAC address. |
@selvanair this would be an incredible feature to have. Worth pointing ou that Microsoft's Always-On solution detects networks by simple DNS suffixes. This is fine in 99% of cases. What about something more complex? I could envisage OpenVPN having a client option such as multiple statements of "trusted network". Each would have hash of {gateway MAC, a custom string delivered via DHCP Option 200}. Since it's encrypted client side, it cannot be ripped out of the config file. Only people who know the unencrytped value can create the network required. This would be a fantastic addition to the product. |
I agree. Even for service mode, without gui. TLS verification of OpenVPN server in a local IP address would be another option, but would not be bullet proof (a malicious computer on a foreign network could tunnelize that traffic to the public interface of the home network). A more robust method to check if we are connected to the home network could be as follows. 1- Connect to the VPN. This would only work to check for the home network, not for other secure networks. Caveats: Would this solution be good enough? |
Dear maintainers,
I am currently experiencing an issue where I need to manually disconnect from OpenVPN every time I physically plug into my office's corporate network. This manual step is necessary to avoid redundant connections and access the office network resources.
Here's what typically happens:
When I connect directly to my corporate network, I need to manually disable OpenVPN once, and then re-enable it immediately. Thankfully, OpenVPN does not establish a connection as long as I'm physically connected to the corporate network, which is good.
However, it would be an improvement if OpenVPN could automatically detect when I'm physically connected to the corporate network and disconnect on its own. Additionally, once it detects that the physical connection is no longer present, it should attempt to reconnect automatically.
This auto-detect and disconnect/connect feature would enhance usability significantly, as it would remove the need for manual intervention every time I transition between network environments.
I look forward to your thoughts on this.
Thanks for your time and consideration.
Pleusch
The text was updated successfully, but these errors were encountered: