Thank You Johan.
The Windows and linux clients connecting to same server (using the same ovpn file), I am able to keep the connection open for 24 hours without reauthentication by entering reneg-sec 0 on server side and reneg-sec 86400 on the client side. It looks like the IOS device is triggering a reauthentication - how can i stop ios client from issueing a reauthentication request for 24 hours? Is it because of iphone going to sleep ? see below:
>>>
ovpn config client:
dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA1
tls-client
client
reneg-sec 0
resolv-retry infinite
remote xxxx.xxxx.xxxx.xxxx 1194 tcp-client
verify-x509-name "vpn.xxxxxx.com" name
auth-user-pass
ns-cert-type server
reneg-sec 86400
**** Log from Windows Workstation using same ovpn config file as the IOS device - No Reauthorization after initial authorization at 22:54 June 13 ****
Sun Jun 13 22:54:17 2021 Attempting to establish TCP connection with [AF_INET]xxx.xxx.xxx.xxx:1194 [nonblock]
Sun Jun 13 22:54:18 2021 TCP connection established with [AF_INET]xxx.xxx.xxx.xxx:1194
Sun Jun 13 22:54:18 2021 TCPv4_CLIENT link local: [undef]
Sun Jun 13 22:54:18 2021 TCPv4_CLIENT link remote: [AF_INET]xxx.xxx.xxx.xxx:1194
Sun Jun 13 22:54:19 2021 [vpn.xxxxx.com] Peer Connection Initiated with [AF_INET]xxxx.xxxx.xxxx.xxxx:1194
Sun Jun 13 22:54:21 2021 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sun Jun 13 22:54:21 2021 open_tun, tt->ipv6=0
Sun Jun 13 22:54:21 2021 TAP-WIN32 device [Local Area Connection 2] opened: \\.\Global\{7E992055- }.tap
Sun Jun 13 22:54:21 2021 Set TAP-Windows TUN subnet mode network/local/netmask = 10.0.182.0/10.0.182.2/255.255.255.0 [SUCCEEDED]
Sun Jun 13 22:54:21 2021 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.0.182.2/255.255.255.0 on interface {7E992055-33BA-414C-A0CA-0DF08F5A109F} [DHCP-serv: 10.0.182.254, lease-time: 31536000]
Sun Jun 13 22:54:21 2021 Successful ARP Flush on interface [24] {7E992055-3}
Sun Jun 13 22:54:26 2021 Initialization Sequence Completed
**** end of log from Windows Workstation ****
***** Log from IOS device (Iphone) that shows reauthorization attempt after a few mins ****
2021-06-13 23:53:18 EVENT: GET_CONFIG
2021-06-13 23:53:18 Sending PUSH_REQUEST to server...
2021-06-13 23:53:19 OPTIONS:
0 [route] [192.168.0.0] [255.255.248.0]
1 [dhcp-option] [DNS] [192.168.0.251]
2 [dhcp-option] [DNS] [8.8.8.8]
3 [route] [192.168.0.0] [255.255.255.0] [10.0.182.1] [1]
4 [route-gateway] [10.0.182.1]
5 [topology] [subnet]
6 [ping] [10]
7 [ping-restart] [86400]
8 [ifconfig] [10.0.182.3] [255.255.255.0]
2021-06-13 23:53:19 PROTOCOL OPTIONS:
cipher: AES-256-CBC
digest: SHA1
compress: NONE
peer ID: -1
2021-06-13 23:53:19 EVENT: ASSIGN_IP
2021-06-13 23:53:19 Connected via NetworkExtensionTUN
2021-06-13 23:53:19 EVENT: CONNECTED
xxxx@domain.com@xxx.xxx.xxx.xxx:1194 via /TCPv4 on NetworkExtensionTUN/10.0.182.3/ gw=[/]
2021-06-13 23:54:50 OS Event: SLEEP
2021-06-13 23:54:50 EVENT: PAUSE
2021-06-13 23:55:36 OS Event: WAKEUP
2021-06-13 23:55:39 RESUME TEST: Internet:ReachableViaWiFi/-R -------
2021-06-13 23:55:39 STANDARD RESUME
2021-06-13 23:55:39 EVENT: RESUME
2021-06-13 23:55:39 EVENT: RECONNECTING
2021-06-13 23:55:39 EVENT: RESOLVE
2021-06-13 23:55:39 Contacting [xxx.xxx.xxx.xxx]:1194/TCP via TCPv4
2021-06-13 23:55:39 EVENT: WAIT
2021-06-13 23:55:39 Connecting to [xxx.xxx.xxx.xxx]:1194 (xxx.xxxx.xxxx.xxxx) via TCPv4
2021-06-13 23:55:39 EVENT: CONNECTING
2021-06-13 23:55:39 Tunnel Options:V4,dev-type tun,link-mtu 1559,tun-mtu 1500,proto TCPv4_CLIENT,keydir 1,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-client
2021-06-13 23:55:39 Creds: Username/Password
2021-06-13 23:55:39 Peer Info:
IV_VER=3.git::58b92569
IV_PLAT=ios
IV_GUI_VER=net.openvpn.connect.ios_3.2.3-3760
IV_SSO=openurl
2021-06-13 23:55:39 VERIFY OK: depth=1, /C=US/ST=Newyork/L=syracuse/O=domain/emailAddress=
xxxx@domain.com/CN=openvpn-ca-default
2021-06-13 23:55:39 VERIFY OK: depth=0,
/C=US/ST=Newyork/L=Syracuse/O=domain/emailAddress=
xxxx@domain.com/CN=vpn.domain.com
2021-06-13 23:55:40 OS Event: SLEEP
2021-06-13 23:55:40 EVENT: PAUSE
2021-06-13 23:58:04 OS Event: WAKEUP
2021-06-13 23:58:07 RESUME TEST: Internet:ReachableViaWiFi/-R -------
2021-06-13 23:58:07 STANDARD RESUME
2021-06-13 23:58:07 EVENT: RESUME
2021-06-13 23:58:07 EVENT: RECONNECTING
2021-06-13 23:58:07 EVENT: RESOLVE
2021-06-13 23:58:07 Contacting [xxx.xxx.xxx.xxx:1194/TCP via TCPv4
2021-06-13 23:58:07 EVENT: WAIT
2021-06-13 23:58:07 Connecting to [xxx.xxx.xxx.xxx]:1194 () via TCPv4
2021-06-13 23:58:07 EVENT: CONNECTING
2021-06-13 23:58:07 Tunnel Options:V4,dev-type tun,link-mtu 1559,tun-mtu 1500,proto TCPv4_CLIENT,keydir 1,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-client
2021-06-13 23:58:07 Creds: Username/Password
2021-06-13 23:58:07 Peer Info:
IV_VER=3.git::58b92569
IV_PLAT=ios
IV_GUI_VER=net.openvpn.connect.ios_3.2.3-3760
IV_SSO=openurl
2021-06-13 23:55:39 VERIFY OK: depth=1, /C=US/ST=Newyork/L=syracuse/O=domain/emailAddress=
xxxx@domain.com/CN=openvpn-ca-default
2021-06-13 23:55:39 VERIFY OK: depth=0,
/C=US/ST=Newyork/L=Syracuse/O=domain/emailAddress=
xxxx@domain.com/CN=vpn.domain.com
2021-06-13 23:58:08 OS Event: SLEEP
2021-06-13 23:58:08 EVENT: PAUSE
2021-06-13 23:59:57 OS Event: WAKEUP
2021-06-14 00:00:00 RESUME TEST: Internet:ReachableViaWiFi/-R -------
2021-06-14 00:00:00 STANDARD RESUME
2021-06-14 00:00:00 EVENT: RESUME
2021-06-14 00:00:00 EVENT: RECONNECTING
2021-06-14 00:00:00 EVENT: RESOLVE
2021-06-14 00:00:00 Contacting [xxx.xxx.xxx.xxx]:1194/TCP via TCPv4
2021-06-14 00:00:00 EVENT: WAIT
2021-06-14 00:00:00 Connecting to [xxx.xxx.xxx.xxx]:1194 ( ) via TCPv4
2021-06-14 00:00:00 EVENT: CONNECTING
2021-06-14 00:00:00 Tunnel Options:V4,dev-type tun,link-mtu 1559,tun-mtu 1500,proto TCPv4_CLIENT,keydir 1,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-client
2021-06-14 00:00:00 Creds: Username/Password
2021-06-14 00:00:00 Peer Info:
IV_VER=3.git::58b92569
IV_PLAT=ios
IV_GUI_VER=net.openvpn.connect.ios_3.2.3-3760
IV_SSO=openurl
2021-06-13 23:55:39 VERIFY OK: depth=1, /C=US/ST=Newyork/L=syracuse/O=domain/emailAddress=
xxxx@domain.com/CN=openvpn-ca-default
2021-06-13 23:55:39 VERIFY OK: depth=0,
/C=US/ST=Newyork/L=Syracuse/O=domain/emailAddress=
xxxx@domain.com/CN=vpn.domain.com
2021-06-14 00:00:01 SSL Handshake: CN=vpn.domain.com, TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 2048 bit RSA
2021-06-14 00:00:01 Session is ACTIVE
2021-06-14 00:00:01 EVENT: GET_CONFIG
2021-06-14 00:00:01 Sending PUSH_REQUEST to server...
2021-06-14 00:00:02 Sending PUSH_REQUEST to server...
2021-06-14 00:00:02 AUTH_FAILED
2021-06-14 00:00:02 EVENT: AUTH_FAILED [ERR]
2021-06-14 00:00:02 Raw stats on disconnect:
BYTES_IN : 19339
BYTES_OUT : 18157
PACKETS_IN : 49
PACKETS_OUT : 60
TUN_BYTES_IN : 1121
TUN_BYTES_OUT : 2860
TUN_PACKETS_IN : 17
TUN_PACKETS_OUT : 17
N_PAUSE : 3
N_RECONNECT : 3
2021-06-14 00:00:02 Performance stats on disconnect:
CPU usage (microseconds): 162643
Tunnel compression ratio (uplink): 16.1971
Tunnel compression ratio (downlink): 6.76189
Network bytes per CPU second: 230541
Tunnel bytes per CPU second: 24476
2021-06-14 00:00:02 EVENT: DISCONNECTED
2021-06-14 00:00:02 Raw stats on disconnect:
BYTES_IN : 19339
BYTES_OUT : 18157
PACKETS_IN : 49
PACKETS_OUT : 60
TUN_BYTES_IN : 1121
TUN_BYTES_OUT : 2860
TUN_PACKETS_IN : 17
TUN_PACKETS_OUT : 17
AUTH_FAILED : 1
N_PAUSE : 3
N_RECONNECT : 3
2021-06-14 00:00:02 Performance stats on disconnect:
CPU usage (microseconds): 171624
Tunnel compression ratio (uplink): 16.1971
Tunnel compression ratio (downlink): 6.76189
Network bytes per CPU second: 218477
Tunnel bytes per CPU second: 23196
****** end of log ios iphone ****