OpenVPN on Laptop and automatically connect/disconnect

How to customize and extend your OpenVPN installation.
Post Reply
dervih
OpenVpn Newbie
Posts: 1
Joined: Tue Sep 07, 2010 10:17 am

OpenVPN on Laptop and automatically connect/disconnect

Post by dervih » Tue Sep 07, 2010 11:21 am

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.

strfr
OpenVpn Newbie
Posts: 4
Joined: Fri Oct 15, 2010 12:46 pm

Re: OpenVPN on Laptop and automatically connect/disconnect

Post by strfr » Fri Oct 15, 2010 1:21 pm

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 ;]

strfr
OpenVpn Newbie
Posts: 4
Joined: Fri Oct 15, 2010 12:46 pm

Re: OpenVPN on Laptop and automatically connect/disconnect

Post by strfr » Sat Oct 16, 2010 10:37 pm

OK, it looks like it could be done through system variables, but I do not know how exactly.. Anybody could give me a hint?

marchand
OpenVpn Newbie
Posts: 1
Joined: Sun Oct 31, 2010 12:04 pm

Re: OpenVPN on Laptop and automatically connect/disconnect

Post by marchand » Sun Oct 31, 2010 12:07 pm

Any news about it ?I would be interested in this

User avatar
krzee
Forum Team
Posts: 729
Joined: Fri Aug 29, 2008 5:42 pm

Re: OpenVPN on Laptop and automatically connect/disconnect

Post by krzee » Thu Nov 04, 2010 10:12 am

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

Post Reply