Page 1 of 1

OpenVPN on Laptop and automatically connect/disconnect

Posted: Tue Sep 07, 2010 11:21 am
by dervih
Hi,

I run OpenVPN client on my laptop. My OpenVPN server is integrated with home LAN and it works in a ethernet bridge mode using a tap device. No ip configuration is provided by the vpn infrastructure. Instead the DHCP server in home LAN is always used both for normal and virtual connection. Thus my laptop is always given the same ip independently if I am home or not.

The problem is that I want the OpenVPN client works as Windows service and automatically connect to my OpenVPN server only when I am not at home. The problem is more complex because I don't switch off my laptop but I hardly always hibernate it. Therefore OpenVPN client service should watch on phisical ethernet devices (note: both wire and wireless) and make decision to connect or disconnect vpn client depending on what ip is given to the phisical ethernet device. If the ip belongs to my home LAN then vpn client automatically disconnects, if not then vpn client automatically connects.

I've digged in the Internet but without a success.
Very thanks for any help.
The problem seems to be a general problem for laptop/notebook vpn client service.

Re: OpenVPN on Laptop and automatically connect/disconnect

Posted: Fri Oct 15, 2010 1:21 pm
by strfr
Hey dervih, I would find this option quite handy too. Actually I have been really trying hard to find some way to keep the service on client machine kind of "stand by" in case you are with your laptop in the destined network.
What's the reason this is not implemented? Are we just missing something guys?

Thanks for great tool anyway ;]

Re: OpenVPN on Laptop and automatically connect/disconnect

Posted: Sat Oct 16, 2010 10:37 pm
by strfr
OK, it looks like it could be done through system variables, but I do not know how exactly.. Anybody could give me a hint?

Re: OpenVPN on Laptop and automatically connect/disconnect

Posted: Sun Oct 31, 2010 12:07 pm
by marchand
Any news about it ?I would be interested in this

Re: OpenVPN on Laptop and automatically connect/disconnect

Posted: Thu Nov 04, 2010 10:12 am
by krzee
i dont know how exactly either, but i can supply a hint
http://openvpn.net/index.php/open-sourc ... .html#lbAR

you could write a script which checks what lan you are on, and decides whether or not it should go further with connecting