How do I make OpenVPN activate when not in ceratin network

I have installed OpenVPN (interested in client only) and it starts automatically on computer boot. As the connection needs user and password, Ubuntu it even asks for them on computer startup.

I noticed that it imposes a problem when I am in the same network to which I am connecting to. My OpenVPN config has a 'route' command that makes me feel like I am in my network when I am away, but it somehow leads to bad connection when I am in that very network physically.

The precise question is how do I configure OpenVPN to activate a connection only when my ip address changes from my home network to some other, or detect that I am away by any other means.

Additional Q#1: Ideally the desired setting should cope with situation when my 4G USB stick assigns me an IP but I still don't have access to my OpenVPN server, because I have to activate internet on it manually: the OpenVPN client fails to connect and never retries.

Additional Q#2: I'd wish to store the user/password in some safe plsce so that it doesn't ask when automatically connects.

I don't have OpenVPN GUI. If the above settings are too hard to implement I will just install it and activate connections when needed...



with network-manager-openvpn-gnome you can solve this problem:

You can configure your network connections to enable a vpn profile if you connect to the network: How do I make OpenVPN activate when not in ceratin network

it's in german, but you should get a clue where to search ..

open your network configuration where you want to have vpn enabled automatically and on general tab switch on the check mark where it says "connect to vpn automatically when this network is used" and select your pre-defined vpn profile.

Category: openvpn Time: 2016-07-29 Views: 0
Tags: openvpn

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.249 (s). 12 q(s)