VPN session expires too quickly

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
johnlm89
OpenVpn Newbie
Posts: 6
Joined: Fri Jul 29, 2011 3:00 am

VPN session expires too quickly

Post by johnlm89 » Fri Jul 29, 2011 3:04 am

Hi,

My VPN session seems to disconnect/expire anywhere from 3-10 minutes after I connect. This is frustrating as I have to keep logging in not to mention I have to resume my stopped downloads.

Is there any way to fix this?

Thanks

User avatar
Bebop
Forum Team
Posts: 301
Joined: Wed Dec 15, 2010 9:24 pm

Re: VPN session expires too quickly

Post by Bebop » Fri Jul 29, 2011 3:49 am

johnlm89 wrote:Is there any way to fix this?
There is (usually). Start by posting your client.conf (or client.ovpn), server.conf, and /etc/openvpn/openvpn.log (if exists).
The cure for boredom is curiosity

johnlm89
OpenVpn Newbie
Posts: 6
Joined: Fri Jul 29, 2011 3:00 am

Re: VPN session expires too quickly

Post by johnlm89 » Fri Jul 29, 2011 7:59 pm

Hi Bebop,

I cannot find these files in my openvpn directory. Any specific folder they should be in?

User avatar
Bebop
Forum Team
Posts: 301
Joined: Wed Dec 15, 2010 9:24 pm

Re: VPN session expires too quickly

Post by Bebop » Fri Jul 29, 2011 8:15 pm

johnlm89 wrote:Hi Bebop,

I cannot find these files in my openvpn directory. Any specific folder they should be in?
in linux (centos/debian/ubuntu):

Code: Select all

cd /etc/openvpn
ls
or

Code: Select all

find /etc/openvpn -name *.conf
Either of those will locate your server.conf file.

In your server.conf you can find a refernce to the location of the server log (if exists).
The cure for boredom is curiosity

johnlm89
OpenVpn Newbie
Posts: 6
Joined: Fri Jul 29, 2011 3:00 am

Re: VPN session expires too quickly

Post by johnlm89 » Fri Jul 29, 2011 9:37 pm

as.conf file
# AS Client API config file for Windows
#
# IMPORTANT NOTE: '~' char refers to the directory that this config
# file is stored in, and not the 'HOME' env var

#DEBUG_SOCK=false
#DEBUG_SHOW_OMI=false
#DEBUG_SW_UPDATE=false
#DEBUG_SCRIPT_TEST=false
#DEBUG_PROFMAN=false
#DEBUG_CLIAPIXML=false

[capi]
openvpn_exe_path=~\..\core\openvpn.exe
python_script_interpreter=~\..\core\py.exe
helper=~\..\core\capihelper.exe
start_tray=true
profile_dir=~\profile
users_dir=~\users
log_dir=~\log
tmp_dir=~\tmp
capi_log=~\log\capi.log
capi_log_append=false
config_dir=~
script_dir=~\scripts
sock=944
document_root=~\..\client
multi_domain_port=946

[capi.swupdate]
work_dir=~\update
install_log=~\msi.log
base_url=http://swupdate.openvpn.net/updates
signing_ca_bundle=~\update-ca.crt
query_period=14400
error_period=120
min_period=14400
tray_nag_period=14400
log file
Wed Jul 27 16:01:46 2011 OpenVPNAS 2.1.3nOAS Win32-MSVC++ [SSL] [LZO2] built on Mar 23 2011
Wed Jul 27 16:01:46 2011 MANAGEMENT: Connected to management server at 127.0.0.1:61276
Wed Jul 27 16:01:46 2011 MANAGEMENT: CMD 'log on'
Wed Jul 27 16:01:46 2011 MANAGEMENT: CMD 'state on'
Wed Jul 27 16:01:46 2011 MANAGEMENT: CMD 'echo on'
Wed Jul 27 16:01:46 2011 MANAGEMENT: CMD 'bytecount 5'
Wed Jul 27 16:01:46 2011 MANAGEMENT: CMD 'hold off'
Wed Jul 27 16:01:46 2011 MANAGEMENT: CMD 'hold release'
Wed Jul 27 16:01:46 2011 MANAGEMENT: CMD 'username "Auth" "ukaqp4cz@cable.acanac.net"'
Wed Jul 27 16:01:46 2011 MANAGEMENT: CMD 'password [...]'
Wed Jul 27 16:01:46 2011 NOTE: OpenVPNAS 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Wed Jul 27 16:01:46 2011 Control Channel Authentication: tls-auth using INLINE static key file
Wed Jul 27 16:01:46 2011 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jul 27 16:01:46 2011 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jul 27 16:01:46 2011 Socket Buffers: R=[8192->100000] S=[8192->100000]
Wed Jul 27 16:01:46 2011 UDPv4 link local: [undef]
Wed Jul 27 16:01:46 2011 UDPv4 link remote: 67.55.0.106:443
Wed Jul 27 16:01:46 2011 MANAGEMENT: >STATE:1311796906,WAIT,,,
Wed Jul 27 16:01:46 2011 MANAGEMENT: >STATE:1311796906,AUTH,,,
Wed Jul 27 16:01:46 2011 TLS: Initial packet from 67.55.0.106:443, sid=14748add 3e48d528
Wed Jul 27 16:01:47 2011 VERIFY OK: depth=1, /CN=OpenVPN_CA
Wed Jul 27 16:01:47 2011 VERIFY OK: nsCertType=SERVER
Wed Jul 27 16:01:47 2011 VERIFY OK: depth=0, /CN=OpenVPN_Server
Wed Jul 27 16:01:47 2011 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Jul 27 16:01:47 2011 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jul 27 16:01:47 2011 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Jul 27 16:01:47 2011 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jul 27 16:01:47 2011 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Wed Jul 27 16:01:47 2011 [OpenVPN_Server] Peer Connection Initiated with 67.55.0.106:443
Wed Jul 27 16:01:48 2011 MANAGEMENT: >STATE:1311796908,GET_CONFIG,,,
Wed Jul 27 16:01:49 2011 SENT CONTROL [OpenVPN_Server]: 'PUSH_REQUEST' (status=1)
Wed Jul 27 16:01:49 2011 PUSH: Received control message: 'PUSH_REPLY,explicit-exit-notify,topology subnet,route-delay 5 30,dhcp-pre-release,dhcp-renew,dhcp-release,route-metric 101,ping 5,ping-restart 40,redirect-gateway def1,redirect-gateway bypass-dhcp,redirect-gateway autolocal,route-gateway 10.0.8.1,dhcp-option DNS 66.49.254.254,dhcp-option DNS 66.49.194.253,dhcp-option DNS 67.55.0.11,register-dns,comp-lzo yes,ifconfig 10.0.8.3 255.255.254.0'
Wed Jul 27 16:01:49 2011 OPTIONS IMPORT: timers and/or timeouts modified
Wed Jul 27 16:01:49 2011 OPTIONS IMPORT: explicit notify parm(s) modified
Wed Jul 27 16:01:49 2011 OPTIONS IMPORT: LZO parms modified
Wed Jul 27 16:01:49 2011 OPTIONS IMPORT: --ifconfig/up options modified
Wed Jul 27 16:01:49 2011 OPTIONS IMPORT: route options modified
Wed Jul 27 16:01:49 2011 OPTIONS IMPORT: route-related options modified
Wed Jul 27 16:01:49 2011 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Wed Jul 27 16:01:49 2011 ROUTE default_gateway=192.168.1.1
Wed Jul 27 16:01:49 2011 MANAGEMENT: >STATE:1311796909,ASSIGN_IP,,10.0.8.3,
Wed Jul 27 16:01:49 2011 TAP-WIN32 device [Local Area Connection 3] opened: \\.\Global\{5692E7FC-6B98-4AEE-9482-0D380084EB6E}.tap
Wed Jul 27 16:01:49 2011 TAP-Win32 Driver Version 9.7
Wed Jul 27 16:01:49 2011 Set TAP-Win32 TUN subnet mode network/local/netmask = 10.0.8.0/10.0.8.3/255.255.254.0 [SUCCEEDED]
Wed Jul 27 16:01:49 2011 Notified TAP-Win32 driver to set a DHCP IP/netmask of 10.0.8.3/255.255.254.0 on interface {5692E7FC-6B98-4AEE-9482-0D380084EB6E} [DHCP-serv: 10.0.9.254, lease-time: 31536000]
Wed Jul 27 16:01:49 2011 Successful ARP Flush on interface [23] {5692E7FC-6B98-4AEE-9482-0D380084EB6E}
Wed Jul 27 16:01:49 2011 NOTE: Release of DHCP-assigned IP address lease on TAP-Win32 adapter failed: An address has not yet been associated with the network endpoint. (code=1228)
Wed Jul 27 16:01:53 2011 TAP: DHCP address renewal succeeded
Wed Jul 27 16:01:58 2011 TEST ROUTES: 1/1 succeeded len=0 ret=1 a=0 u/d=up
Wed Jul 27 16:01:58 2011 ROUTE remote_host is NOT LOCAL
Wed Jul 27 16:01:58 2011 C:\Windows\system32\route.exe ADD 67.55.0.106 MASK 255.255.255.255 192.168.1.1
Wed Jul 27 16:01:58 2011 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=20 and dwForwardType=4
Wed Jul 27 16:01:58 2011 Route addition via IPAPI succeeded [adaptive]
Wed Jul 27 16:01:58 2011 C:\Windows\system32\route.exe ADD 0.0.0.0 MASK 128.0.0.0 10.0.8.1
Wed Jul 27 16:01:58 2011 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Wed Jul 27 16:01:58 2011 Route addition via IPAPI succeeded [adaptive]
Wed Jul 27 16:01:58 2011 C:\Windows\system32\route.exe ADD 128.0.0.0 MASK 128.0.0.0 10.0.8.1
Wed Jul 27 16:01:58 2011 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Wed Jul 27 16:01:58 2011 Route addition via IPAPI succeeded [adaptive]
Wed Jul 27 16:01:58 2011 Initialization Sequence Completed
Wed Jul 27 16:01:58 2011 MANAGEMENT: >STATE:1311796918,CONNECTED,SUCCESS,10.0.8.3,67.55.0.106
Wed Jul 27 16:01:58 2011 Start net commands...
Wed Jul 27 16:01:58 2011 C:\WINDOWS\system32\net.exe stop dnscache
The DNS Client service is stopping..
The DNS Client service could not be stopped.

Wed Jul 27 16:02:03 2011 C:\WINDOWS\system32\net.exe start dnscache
The requested service has already been started.

More help is available by typing NET HELPMSG 2182.

Wed Jul 27 16:02:03 2011 ERROR: Windows ipconfig command failed: returned error code 2
Wed Jul 27 16:02:03 2011 C:\WINDOWS\system32\ipconfig.exe /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.
Wed Jul 27 16:02:04 2011 C:\WINDOWS\system32\ipconfig.exe /registerdns

Windows IP Configuration

Registration of the DNS resource records for all adapters of this computer has been initiated. Any errors will be reported in the Event Viewer in 15 minutes.
Wed Jul 27 16:02:07 2011 End net commands...
Wed Jul 27 16:02:16 2011 MANAGEMENT: CMD 'exit'
Wed Jul 27 16:02:16 2011 MANAGEMENT: Client disconnected
Wed Jul 27 16:02:16 2011 MANAGEMENT: Triggering management exit
Wed Jul 27 16:02:16 2011 SIGTERM received, sending exit notification to peer
Wed Jul 27 16:02:17 2011 C:\Windows\system32\route.exe DELETE 67.55.0.106 MASK 255.255.255.255 192.168.1.1
Wed Jul 27 16:02:17 2011 Route deletion via IPAPI succeeded [adaptive]
Wed Jul 27 16:02:17 2011 C:\Windows\system32\route.exe DELETE 0.0.0.0 MASK 128.0.0.0 10.0.8.1
Wed Jul 27 16:02:17 2011 Route deletion via IPAPI succeeded [adaptive]
Wed Jul 27 16:02:17 2011 C:\Windows\system32\route.exe DELETE 128.0.0.0 MASK 128.0.0.0 10.0.8.1
Wed Jul 27 16:02:17 2011 Route deletion via IPAPI succeeded [adaptive]
Wed Jul 27 16:02:17 2011 Closing TUN/TAP interface
Wed Jul 27 16:02:17 2011 TAP: DHCP address released
Wed Jul 27 16:02:17 2011 SIGTERM[soft,exit-with-notification] received, process exiting
Wed Jul 27 16:02:17 2011 MANAGEMENT: >STATE:1311796937,EXITING,exit-with-notification,,

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: VPN session expires too quickly

Post by Mimiko » Sat Jul 30, 2011 8:05 am

Hello.

So, you are on Windows. It always good to mention the system, on which you have trouble.

I think its not OpenVPN problem. From you client's log:
Wed Jul 27 16:01:58 2011 C:\WINDOWS\system32\net.exe stop dnscache
The DNS Client service is stopping..
The DNS Client service could not be stopped.
May be your client does not have enough privileges.
Wed Jul 27 16:02:03 2011 ERROR: Windows ipconfig command failed: returned error code 2
Wed Jul 27 16:02:03 2011 C:\WINDOWS\system32\ipconfig.exe /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.
OpenVPN sees that it cannot flush dns with first method and tryies the second.

OpenVPN does this because server pushes DNS settings for your client.
Wed Jul 27 16:02:16 2011 MANAGEMENT: CMD 'exit'
Are you sure that on the server side no one disconnects you or has a script that disconnects? It's external managed request to disconnect. And I see that you are disconnected not after 3-10 min, just immediatly.

johnlm89
OpenVpn Newbie
Posts: 6
Joined: Fri Jul 29, 2011 3:00 am

Re: VPN session expires too quickly

Post by johnlm89 » Sat Jul 30, 2011 4:14 pm

Yes I am on windows 7, I have almost no knowledge of programming/networking. I am also running it in my house, through a router.

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: VPN session expires too quickly

Post by Mimiko » Sun Jul 31, 2011 4:40 pm

I don' have a OpenVPN AS client to see it. So type the full path to the as.conf you finded. There may be some config files also.

johnlm89
OpenVpn Newbie
Posts: 6
Joined: Fri Jul 29, 2011 3:00 am

Re: VPN session expires too quickly

Post by johnlm89 » Wed Aug 03, 2011 8:06 am

C:\Program Files (x86)\OpenVPN Technologies\OpenVPN Client\etc

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: VPN session expires too quickly

Post by Mimiko » Wed Aug 03, 2011 12:01 pm

You can look in "profile" folder under this folder and see the files. In the content you will see the connection address.

The log you post, where did you get it?

Did you try to authenticate from OpenVPN AS site? Can you download from the site the installer of OpenVPN connect and reintsall it?

johnlm89
OpenVpn Newbie
Posts: 6
Joined: Fri Jul 29, 2011 3:00 am

Re: VPN session expires too quickly

Post by johnlm89 » Wed Aug 03, 2011 7:38 pm

Okay I downloaded the client version. Seems to be working fine now. Thanks for you help guys, sorry I wasn't as tech savvy as the rest of the forum.

Post Reply