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...