[solved] How to use keep alive in client script

How to customize and extend your OpenVPN installation.

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

Post Reply
jumper
OpenVpn Newbie
Posts: 10
Joined: Tue Dec 06, 2011 1:35 am

[solved] How to use keep alive in client script

Post by jumper » Tue Dec 06, 2011 10:45 pm

Hello. I'm new and have searched and not found an answer to my question. I would like to put a keep alive parameter in my client config, but when I do, it does not work. I'm on Windows 7 sp1. and here is my current client config.

Code: Select all

client
auth-nocache
auth-user-pass

#dev tap
dev tun
;connect_retry_max = 10

;dev-node MyTap

;proto tcp
proto udp

;remote my-server-1 1194
;remote my-server-2 1194
;remote ***.***.*****.*** 1194
remote ******.*****.*****.*** 1194

;remote-random

resolv-retry infinite

nobind

;user nobody
;group nobody

persist-key
persist-tun

;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]

;mute-replay-warnings

ca *****.***
remote-cert-tls server
;cert client.crt
;key client.key

;ns-cert-type server

;tls-auth ta.key 1

;cipher x

;comp-lzo

script-security 3

# Set log file verbosity.
verb 3

# Silence repeating messages
;mute 20
Without some sort of keep alive mechanism, I will lose connection while reading a web page or if I walk away from the computer for a few minutes. OpenVpn will pop up a dialogbox for me to re-enter my information, but it does not work this way. I have to cancel and restart by double-clicking the tray icon. Then it will log into the server.

I tried using a timeout param I saw in one post, but when I put it into the script, OpenVpn doesn't work at all. When I double-click on the icon, it immediately says "Failed" (plus something else that I can't remember right now).

I would appreciate any help.
thanks
Last edited by jumper on Tue Dec 06, 2011 11:36 pm, edited 1 time in total.

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: How to use keep alive in client script

Post by janjust » Tue Dec 06, 2011 11:01 pm

doe

Code: Select all

keepalive 10 60
not work?

jumper
OpenVpn Newbie
Posts: 10
Joined: Tue Dec 06, 2011 1:35 am

Re: How to use keep alive in client script

Post by jumper » Tue Dec 06, 2011 11:34 pm

Thanks Janjust... my problem was with the values I was using. The windows GUI did not give an error message that let me know "what" was going on, but I found out by running the script from the command prompt. THEN I got the error stating what the parameters should be and that the second parameter should be (n) amount greater than the first.

Once I changed the second param, everything worked fine.

I was just getting ready to post a "never mind, I figured it out" message, then I saw you had responded. You do a lot of good work around here. Don't know if you're part of the management or what, but you know your stuff ;)

thanks bud.

jumper
OpenVpn Newbie
Posts: 10
Joined: Tue Dec 06, 2011 1:35 am

Re: [solved] How to use keep alive in client script

Post by jumper » Tue Dec 06, 2011 11:45 pm

Here's a great tip for anyone using the windows GUI.
If you are having problems with something and your script does not work,
right-click on your .ovpn file and select "Start OpenVpn on this config file".

This will run OpenVpn in a dos window and if there are errors you will get much more information about the errors than the GUI will give you. The GUI gives you pretty much nothing.

have a good one...

Post Reply