OpenVPN service on Server 2008

Had a bit of pain setting up OpenVPN 2.1.1 client on my Windows Server 2008 x64 box. OpenVPN is a great SSL open source VPN solution with a helpful community base, if you are in need of a VPN solution I highly recommend it.

The issue I was suffering from was after a reboot of the 2008 box the service would start but not connect

with an error pointing towards a firewall blocking the Open VPN server (CentOS) assigning a gateway to the TAP-Win32 Nic. After restarting the service all would connect fine, so I was sure a firewall was not the issue. After a lot of trial and error the following setup worked around the issue...

 

  • Build a task that run 5 mins after boot, repeated every 5 mins for 10 mins
  • The above tasks runs a bat file with the following
    • net stop OpenVPNService
    • ECHO Waiting 15 seconds
    • PING 127.0.0.1 -n 1 -w 15000 > NUL
    • net start OpenVPNService

For some reason one restart of the service is not enough and there has to be a delay before starting again. Hopefully this will be helpful to some stuck in the same situation.

Tagged under tech