I installed openVPN on ubuntu 18.04 server and use
https://git.io/vpn for installing openVPN on my server.
I changed server config for able to connect several users with an ovpn file with :
duplicate-cn
So here is my question:
I wanna when a user's device goes to sleep VPN disconnects and do not reconnect again ( I mean preventing something like alwaysOn or on-demand in iOS)
I tried to eliminate
keepalive
and add
inactive 50
and
ping-exit 50
and
ping-restart 0
but it didn't work form me. what is the problem??
Here is my server.conf
local serverIp
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
#client-cert-not-required
#username-as-common-name
#plugin /usr/lib/x86_64-linux-gnu/openvpn/plugins/openvpn-plugin-auth-pam.so /e$
tls-crypt tc.key
topology subnet
inactive 50
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
cipher AES-256-CBC
user nobody
group nogroup
persist-key
status openvpn-status.log
log /var/log/openvpn/openvpn.log
log-append /var/log/openvpn/openvpn.log
verb 3
crl-verify crl.pem
explicit-exit-notify
and here is my client.ovpn config
client
dev tun
proto udp
remote serevrIp 1194
resolv-retry 0
nobind
persist-key
#auth-user-pass
inactive 50
ping-exit 50
ping-restart 0
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3
....