I recently got a new computer and set up Ubuntu 12.04, replacing my old PC. On my old PC, I used OpenVPN GUI and everything worked fine. Now, with the same config file, OpenVPN is giving me trouble on Ubuntu. It times out and then reconnects at uneven intervals. Below you'll find some of the log and my config file, with "X" replacing private information.
In this log, OpenVPN connects succesfully, then times out after a few minutes (at 16:04), and tries to reconnect and has a different timeout behavior.
Sun Sep 8 16:02:08 2013 OpenVPN 2.2.1 x86_64-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Feb 27 2013
Sun Sep 8 16:02:08 2013 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Enter Private Key Password:
Sun Sep 8 16:02:11 2013 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sun Sep 8 16:02:11 2013 WARNING: file 'XXXXXX.p12' is group or others accessible
Sun Sep 8 16:02:11 2013 LZO compression initialized
Sun Sep 8 16:02:11 2013 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Sep 8 16:02:11 2013 Socket Buffers: R=[212992->131072] S=[212992->131072]
Sun Sep 8 16:02:11 2013 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Sep 8 16:02:11 2013 Local Options hash (VER=V4): '41690919'
Sun Sep 8 16:02:11 2013 Expected Remote Options hash (VER=V4): '530fdded'
Sun Sep 8 16:02:11 2013 UDPv4 link local (bound): [undef]
Sun Sep 8 16:02:11 2013 UDPv4 link remote: [AF_INET]XXX.XXX.XX.XXX:1195
Sun Sep 8 16:02:11 2013 TLS: Initial packet from [AF_INET]XXX.XXX.XX.XXX:1195, sid=380c764c 085e9000
Sun Sep 8 16:02:11 2013 VERIFY OK: depth=1, /C=US/O=XXXXXX/CN=XXXXX/emailAddress=admin@XXXXXXX
Sun Sep 8 16:02:11 2013 VERIFY OK: nsCertType=SERVER
Sun Sep 8 16:02:11 2013 VERIFY OK: depth=0, /C=US/O=XXXXXX/CN=XXXXXXXX
Sun Sep 8 16:02:12 2013 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sun Sep 8 16:02:12 2013 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Sep 8 16:02:12 2013 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sun Sep 8 16:02:12 2013 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Sep 8 16:02:12 2013 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Sun Sep 8 16:02:12 2013 [XXXXXXXXX] Peer Connection Initiated with [AF_INET]XXX.XXX.XX.XXX:1195
Sun Sep 8 16:02:14 2013 SENT CONTROL [XXXXXXXXX]: 'PUSH_REQUEST' (status=1)
Sun Sep 8 16:02:15 2013 PUSH: Received control message: 'PUSH_REPLY,route 192.168.0.0 255.255.255.0,route 192.168.2.0 255.255.255.0,route 192.168.1.1,ping 10,ping-restart 60,ifconfig XXX.XXX.XX.XX XXX.XXX.XX.XX'
Sun Sep 8 16:02:15 2013 OPTIONS IMPORT: timers and/or timeouts modified
Sun Sep 8 16:02:15 2013 OPTIONS IMPORT: --ifconfig/up options modified
Sun Sep 8 16:02:15 2013 OPTIONS IMPORT: route options modified
Sun Sep 8 16:02:15 2013 WARNING: potential TUN/TAP adapter subnet conflict between local LAN [192.168.1.0/255.255.255.0] and remote VPN [XXX.XXX.XX.XX/255.255.255.255]
Sun Sep 8 16:02:15 2013 ROUTE default_gateway=192.168.1.1
Sun Sep 8 16:02:15 2013 TUN/TAP device tun0 opened
Sun Sep 8 16:02:15 2013 TUN/TAP TX queue length set to 100
Sun Sep 8 16:02:15 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sun Sep 8 16:02:15 2013 /sbin/ifconfig tun0 192.168.1.26 pointopoint 192.168.1.25 mtu 1500
Sun Sep 8 16:02:15 2013 /sbin/route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.1.25
Sun Sep 8 16:02:15 2013 /sbin/route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.1.25
Sun Sep 8 16:02:15 2013 WARNING: potential route subnet conflict between local LAN [192.168.1.0/255.255.255.0] and remote VPN [192.168.1.1/255.255.255.255]
Sun Sep 8 16:02:15 2013 /sbin/route add -net 192.168.1.1 netmask 255.255.255.255 gw 192.168.1.25
Sun Sep 8 16:02:15 2013 Initialization Sequence Completed
Sun Sep 8 16:04:22 2013 [XXXXXXXXX] Inactivity timeout (--ping-restart), restarting
Sun Sep 8 16:04:22 2013 TCP/UDP: Closing socket
Sun Sep 8 16:04:22 2013 /sbin/route del -net 192.168.1.1 netmask 255.255.255.255
Sun Sep 8 16:04:22 2013 /sbin/route del -net 192.168.2.0 netmask 255.255.255.0
Sun Sep 8 16:04:22 2013 /sbin/route del -net 192.168.0.0 netmask 255.255.255.0
Sun Sep 8 16:04:22 2013 Closing TUN/TAP interface
Sun Sep 8 16:04:22 2013 /sbin/ifconfig tun0 0.0.0.0
Sun Sep 8 16:04:22 2013 SIGUSR1[soft,ping-restart] received, process restarting
Sun Sep 8 16:04:22 2013 Restart pause, 2 second(s)
Sun Sep 8 16:04:24 2013 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Sun Sep 8 16:04:24 2013 WARNING: file 'XXXXXX.p12' is group or others accessible
Sun Sep 8 16:04:24 2013 LZO compression initialized
Sun Sep 8 16:04:24 2013 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Sep 8 16:04:24 2013 Socket Buffers: R=[212992->131072] S=[212992->131072]
Sun Sep 8 16:04:24 2013 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Sep 8 16:04:24 2013 Local Options hash (VER=V4): '41690919'
Sun Sep 8 16:04:24 2013 Expected Remote Options hash (VER=V4): '530fdded'
Sun Sep 8 16:04:24 2013 UDPv4 link local (bound): [undef]
Sun Sep 8 16:04:24 2013 UDPv4 link remote: [AF_INET]XXX.XXX.XX.XXX:1195
Sun Sep 8 16:05:24 2013 [UNDEF] Inactivity timeout (--ping-restart), restarting
Sun Sep 8 16:05:24 2013 TCP/UDP: Closing socket
Sun Sep 8 16:05:24 2013 SIGUSR1[soft,ping-restart] received, process restarting
Sun Sep 8 16:05:24 2013 Restart pause, 2 second(s)
Sun Sep 8 16:05:26 2013 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Sun Sep 8 16:05:26 2013 WARNING: file 'XXXXXXX.p12' is group or others accessible
Sun Sep 8 16:05:26 2013 LZO compression initialized
Sun Sep 8 16:05:26 2013 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Sep 8 16:05:26 2013 Socket Buffers: R=[212992->131072] S=[212992->131072]
Sun Sep 8 16:05:26 2013 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Sep 8 16:05:26 2013 Local Options hash (VER=V4): '41690919'
Sun Sep 8 16:05:26 2013 Expected Remote Options hash (VER=V4): '530fdded'
Sun Sep 8 16:05:26 2013 UDPv4 link local (bound): [undef]
Sun Sep 8 16:05:26 2013 UDPv4 link remote: [AF_INET]XXX.XXX.XX.XXX:1195
Sun Sep 8 16:06:27 2013 [UNDEF] Inactivity timeout (--ping-restart), restarting
I always get repeated "Inactivity timeout (--ping-restart), restarting" errors, sometimes it's after successfully connecting, and sometimes it has [UNDEF] as part of the message, after unsuccesfully connecting. I've tried adding the keepalive command to my config file and it doesn't help. There are no other connections to the server using the same private key. Any ideas? Here's the config file (that worked in windows, using OpenVPN GUI)
#OpenVPN Client conf
tls-client
client
dev tun
proto udp
tun-mtu 1500
remote XXX.XXX.XX.XXX 1195
pkcs12 XXXXXXXX.p12
cipher BF-CBC
comp-lzo
verb 3
ns-cert-type server