Page 1 of 1

System time at bootup not correct, Key authentication fails

Posted: Wed Dec 08, 2010 3:24 am
by ekiller200
I am running an OpenVPN client on a somewhat limited hardware.. there is not BOIS Battery to keep system time. I am using the openVPN init.d script that was part of the Ubuntu OpenVPN package. Normally, the network comes up first, gets the system time from the a NTP server, and then OpenVPN starts up fine without any issues.

Sometimes, the network does not come up, or it can not reach the NTP server right away (in most cases the network cord is unplugged). OpenVPN starts but fails because the system time is very much in the past according to the crt's.

Eventually, networking comes back up and the system time gets set. But as far as I can tell, there is no built in way to handle this in openVPN.

any suggestion on how I this should be handled?

I was thinking I could write a cron script that would check system time some how, and restart the VPN when it is correct, but that just seems more complicated than it needs to be.

Thanks,

Re: System time at bootup not correct, Key authentication fa

Posted: Wed Dec 22, 2010 8:04 pm
by gladiatr72
Hello,

I think you'd be better served by wrapping openvpn and ntpdate with a script that will monitor your network connection before trying to run either. If you are getting your network config via dhcp, you can use the client's scripting hooks to execute a script that will execute ntpdate, check a non-zero error code then continue on to start the vpn connection (otherwise, wait for n seconds before trying ntpdate again or even try a different ntp server).

Regards,
Stephen