Page 1 of 1

Problems Connecting to EdgeRouterX OpenVPN - KEEPALIVE_TIMEOUT

Posted: Fri Apr 07, 2017 3:48 pm
by APag96
I'm just recently starting having issues connecting to the 192.168.210.0/24 subnet that my server pushes to clients. I am the only one with access to the OpenVPN server, and I have not made any changes recently.

This is only affecting the OpenVPN Client on my Android phone, and is not affecting the Tunnelblik connection from my Mac. Both my phone and Tunnelblick use the exact same config (below).

The OpenVPN Connect Android client is running v1.1.17 (build 76). My first thoughts were that the client was recently updates, but I see that the last update to this application was last month.

I took a look at the OpenVPN Connect logs on my Android phone and noticed that the connection to the server is re-established every 60 seconds. Please see the below screenshot. I apologize, but I was unable to copy the text from the logs, so that's why I'm posting this picture instead.

Image

Code: Select all

Session invalidated: KEEPALIVE_TIMEOUT 
Client terminated, restarting in 2...
The above leads me to believe that the connection is being re-established because of something to do with the ping-restart option pushed to clients. If that were the case, I'd imagine I'd get at least some traffic to pass from client->server before the timeout, but that doesn't seem to be happening.

Could someone give me a hand here? I'm not really sure how to proceed. Thank you!

OpenVPN Server Config:
I realize this is not the "standard" layout for OpeVPN server configuration, but I hope this will suffice

Code: Select all

admin@ubnt# show interfaces openvpn vtun0
 encryption aes256
 mode server
 openvpn-option --duplicate-cn
 server {
     push-route 192.168.210.0/24
     subnet 10.55.0.0/24
 }
 tls {
     ca-cert-file /config/auth/cacert.pem
     cert-file /config/auth/host.pem
     dh-file /config/auth/dhp.pem
     key-file /config/auth/host.key
 }
 
OpenVPN Client Config:

Code: Select all

persist-tun
persist-key
tls-client
dev tun
client
remote **REDACTED** 1194 udp

<ca>
-----BEGIN CERTIFICATE-----
**REDACTED**
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
**REDACTED**
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN RSA PRIVATE KEY-----
**REDACTED**
-----END RSA PRIVATE KEY-----
</key>

Re: Problems Connecting to EdgeRouterX OpenVPN - KEEPALIVE_TIMEOUT

Posted: Fri Apr 07, 2017 4:07 pm
by TinCanTech
APag96 wrote:OpenVPN Server Config:
I realize this is not the "standard" layout for OpeVPN server configuration, but I hope this will suffice

Code: Select all

admin@ubnt# show interfaces openvpn vtun0
 encryption aes256
 mode server
 openvpn-option --duplicate-cn
 server {
     push-route 192.168.210.0/24
     subnet 10.55.0.0/24
 }
 tls {
     ca-cert-file /config/auth/cacert.pem
     cert-file /config/auth/host.pem
     dh-file /config/auth/dhp.pem
     key-file /config/auth/host.key
 }
What OS is your server ?


PLease see:
viewtopic.php?f=30&t=22603#p68963

Re: Problems Connecting to EdgeRouterX OpenVPN - KEEPALIVE_TIMEOUT

Posted: Fri Apr 07, 2017 6:30 pm
by APag96
The OpenVPN server is running on a Ubiquiti Networks EdgeRouter X

Re: Problems Connecting to EdgeRouterX OpenVPN - KEEPALIVE_TIMEOUT

Posted: Fri Apr 07, 2017 6:34 pm
by APag96
To add to my last response:

I don't think the OpenVPN server is using a config file. Instead, it looks like the EdgeRouter is passing all of the config via arguments:

Code: Select all

/usr/sbin/openvpn --daemon --verb 3 --writepid /var/run/openvpn-vtun0.pid --status /var/run/openvpn/status/vtun0.status 30 --dev-type tun --dev vtun0 --mode server --tls-server --topology subnet --keepalive 10 60 --proto udp --cipher aes-256-cbc --ca /config/auth/cacert.pem --cert /config/auth/host.pem --key /config/auth/host.key --dh /config/auth/dhp.pem --management /tmp/openvpn-mgmt-intf unix --push route 192.168.210.0 255.255.255.0 --server 10.55.0.0 255.255.255.0 --client-config-dir /var/run/openvpn/ccd/vtun0 --duplicate-cn

Re: Problems Connecting to EdgeRouterX OpenVPN - KEEPALIVE_TIMEOUT

Posted: Sat Apr 08, 2017 5:12 pm
by TinCanTech
In your server disable the use of --client-config-dir and let us know the result.

You may also have to find a way to enable logging on your server.