System time at bootup not correct, Key authentication fails

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
ekiller200
OpenVpn Newbie
Posts: 1
Joined: Wed Dec 08, 2010 3:09 am

System time at bootup not correct, Key authentication fails

Post by ekiller200 » Wed Dec 08, 2010 3:24 am

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,

User avatar
gladiatr72
Forum Team
Posts: 194
Joined: Mon Dec 13, 2010 3:51 pm
Location: Lawrence, KS

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

Post by gladiatr72 » Wed Dec 22, 2010 8:04 pm

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
[..]I used to think it was awful that life was so unfair. [...]Wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? -Marcus Cole

Post Reply