Wednesday, April 08, 2009

OpenVPN

OpenVPN can be configured to run a Windows batch script depending on the connection state of your OpenVPN client. Here are the details: The used SSL VPN Client Supports the use of connect and disconnect scripts. I simply created some batchscripts for connect and disconnect, which simply contains following commands in it:

ipconfig /flushdns
nbtstat -R
ipconfig /registerdns

This will flush DNS and NetBios Caches and use the newly delivered DNS. But you have to rename the default profilename "UserX@domainy.zzz" and *ovpn filename to a name without special characters as "@" to get you batchfiles to work.

That way also can be used to map network drives and do other nice things ;)

Run Connect/Disconnect/Preconnect Scripts
-----------------------------------------

There are three diffrent scripts that OpenVPN GUI can execute to help with diffrent tasks like mapping network drives.

Preconnect If a file named "***_pre.bat" exist in the config folder where *** is the same as your OpenVPN config file name, this will be executed BEFORE the OpenVPN tunnel is established.

Connect If a file named "***_up.bat" exist in the config folder where *** is the same as your OpenVPN config file name, this will be executed AFTER the OpenVPN tunnel is established.

Disconnect If a file named "***_down.bat" exist in the config folder where *** is the same as your OpenVPN config file name, this will be executed BEFORE the OpenVPN tunnel is closed.

Base information found under following link: http://openvpn.se/install.txt

No comments: