[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: Alexander Hoogerhuis <alexh@xxxxxxxx>
  • Date: Sat, 15 Dec 2007 22:27:33 +0100

Jan Just Keijser wrote:
> 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.

I forgot to add, what I'm probably looking for is the non-existant --up 
counterpart to --down-pre, that I could do my tests and then stop it 
attempt the connect in the first place.

> HTH / groetjes,
OpenVPN mailing lists