[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Web openvpn.net

Re: [Openvpn-users] How to make 2.0.x conditionally connect?

  • Subject: Re: [Openvpn-users] How to make 2.0.x conditionally connect?
  • From: Jan Just Keijser <janjust@xxxxxxxxx>
  • Date: Fri, 14 Dec 2007 12:41:57 +0100

Use an
  --up cmd
script. This script is called as
  cmd tun_dev tun_mtu link_mtu ifconfig_local_ip ifconfig_remote_ip [ 
init | restart ]
If the command exits with an error code openvpn aborts. So if you write 
an 'up' script that does something like

echo "%4" | find "192.168.1"
if errorlevel 1 exit 0
exit 1

then the 'up' script will abort if the local IP is not in the 192.168.1 
range; this should cause openvpn to stop attempting to connect. It will 
mean that your openvpn log file will see some errors when you're at home.

HTH / groetjes,


*Alexander Hoogerhuis wrote:
> I'm looking around for a mechanism to have the client check it's IP and 
> only bring up the service in Windows XP if the client's does not have an 
> IP in a given range. In simple terms, if the client is connected to 
> then don't start the service, as I'm already at home, and 
> if I'm not in that range, then continue starting as normal.

Openvpn-users mailing list