Hello,
my rt-ac68u is configured to start a openvpn client at boot time, but it often fails, although I have no problem when I manually start the client once router is up. Therefore I would like to know how I could delay the effective start of the vpn service until the wan is restored.
To be more precise I think one origin of the openvpn client problem is caused by the NTP update because it is happening in the middle of the negotiation process. Indeed, before NTP update time is "Dec 1 01:00:xx" and after it is the real current time, and that's why the remote openvpn server is complaining about a timeout and is aborting the TLS negotiation!!!
here is some log excerpt
So is it possible (at boot) to delay the open vpn client start until the wan is up and the time has been set?
thanks.
my rt-ac68u is configured to start a openvpn client at boot time, but it often fails, although I have no problem when I manually start the client once router is up. Therefore I would like to know how I could delay the effective start of the vpn service until the wan is restored.
To be more precise I think one origin of the openvpn client problem is caused by the NTP update because it is happening in the middle of the negotiation process. Indeed, before NTP update time is "Dec 1 01:00:xx" and after it is the real current time, and that's why the remote openvpn server is complaining about a timeout and is aborting the TLS negotiation!!!
here is some log excerpt
Code:
.....
Dec 1 01:00:28 openvpn[793]: Expected Remote Options hash (VER=V4): .....
Dec 1 01:00:28 openvpn[794]: UDPv4 link local: [undef]
Dec 1 01:00:28 openvpn[794]: UDPv4 link remote: [AF_INET]....
Dec 1 01:00:29 WAN Connection: WAN was restored. <---- Here the wan is available
Dec 1 01:00:29 ntp: start NTP update <-- still waiting for time update
......
Dec 1 01:00:30 openvpn[794]: TLS: Initial packet from [AF_INET]..... <-negociation start here "Dec 1"
Dec 1 01:00:31 openvpn[794]: VERIFY OK: ...
Dec 1 01:00:31 openvpn[794]: VERIFY X509NAME .....
....
Dec 1 01:00:32 ntp: start NTP update <----- Still waiting for time update.....
...
May 23 21:23:00 openvpn[794]: Data Channel Encrypt: <---- negociation continues here on "May 23"!!
May 23 21:23:00 openvpn[794]: Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
May 23 21:23:00 openvpn[794]: Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
May 23 21:23:00 openvpn[794]: Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
May 23 21:23:00 openvpn[794]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
^------------- TIMEOUT !!!!
May 23 21:23:00 openvpn[794]: TLS Error: TLS handshake failed
May 23 21:23:00 rc_service: ntp 668:notify_rc restart_upnp
May 23 21:23:00 rc_service: waitting "restart_nasapps" via ...
May 23 21:23:01 openvpn[794]: TCP/UDP: Closing socket
May 23 21:23:01 openvpn[794]: SIGUSR1[soft,tls-error] received, process restarting
May 23 21:23:01 openvpn[794]: Restart pause, 2 second(s)
So is it possible (at boot) to delay the open vpn client start until the wan is up and the time has been set?
thanks.