Thank you for these clarifications.
Here is a log snippet illustrating the issue (--client-disconnect executed after --client-connect for the "client-pc" common name):
Fri Jul 27 16:24:51 2018 BB.BBB.BBB.BBB:3457 WARNING: normally if you use --mssfix and/or --fragment, you should also set --tun-mtu 1500 (currently it is 1342)
Fri Jul 27 16:24:51 2018 BB.BBB.BBB.BBB:3457 TLS: Initial packet from [AF_INET]BB.BBB.BBB.BBB:3457, sid=0cc5a1a3 f42b2218
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 VERIFY OK: depth=1, C=BE, ST=**, L=********, O=*******, OU=IT, CN=******* CA, name=server, emailAddress=*****@gmail.com
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 VERIFY OK: depth=0, C=BE, ST=**, L=********, O=*******, OU=IT, CN=router-4g, name=server, emailAddress=*****@gmail.com
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1384', remote='link-mtu 1542'
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 WARNING: 'tun-mtu' is used inconsistently, local='tun-mtu 1342', remote='tun-mtu 1500'
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 WARNING: 'ifconfig' is present in remote config but missing in local config, remote='ifconfig 10.8.0.181 10.8.0.182'
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Fri Jul 27 16:24:54 2018 BB.BBB.BBB.BBB:3457 [router-4g] Peer Connection Initiated with [AF_INET]BB.BBB.BBB.BBB:3457
## --client-disconnect [router-4g]
Fri Jul 27 16:24:55 2018 MULTI: new connection by client 'router-4g' will cause previous active sessions by this client to be dropped. Remember to use the --duplicate-cn option if you want multiple clients using the same certificate or username to concurrently connect.
Fri Jul 27 16:24:55 2018 MULTI_sva: pool returned IPv4=10.8.0.182, IPv6=(Not enabled)
## --client-connect [router-4g]
Fri Jul 27 16:24:56 2018 OPTIONS IMPORT: reading client specific options from: /tmp/openvpn_cc_d55181add5b443984c0d5e06c01db076.tmp
Fri Jul 27 16:24:56 2018 MULTI: Learn: 10.8.0.182 -> router-4g/BB.BBB.BBB.BBB:3457
Fri Jul 27 16:24:56 2018 MULTI: primary virtual IP for router-4g/BB.BBB.BBB.BBB:3457: 10.8.0.182
Fri Jul 27 16:25:01 2018 client-pc/AA.AAA.AAA.AAA:3260 TLS: tls_process: killed expiring key
Fri Jul 27 16:25:03 2018 client-pc/AA.AAA.AAA.AAA:3260 TLS: soft reset sec=0 bytes=244207/0 pkts=2121/0
Fri Jul 27 16:26:03 2018 client-pc/AA.AAA.AAA.AAA:3260 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Jul 27 16:26:03 2018 client-pc/AA.AAA.AAA.AAA:3260 TLS Error: TLS handshake failed
Fri Jul 27 16:26:03 2018 client-pc/AA.AAA.AAA.AAA:3260 TLS: move_session: dest=TM_LAME_DUCK src=TM_ACTIVE reinit_src=1
Fri Jul 27 16:26:07 2018 BB.BBB.BBB.BBB:3894 WARNING: normally if you use --mssfix and/or --fragment, you should also set --tun-mtu 1500 (currently it is 1342)
Fri Jul 27 16:26:07 2018 BB.BBB.BBB.BBB:3894 TLS: Initial packet from [AF_INET]BB.BBB.BBB.BBB:3894, sid=fc0f57f6 d5898308
Fri Jul 27 16:26:08 2018 BB.BBB.BBB.BBB:3894 VERIFY OK: depth=1, C=BE, ST=**, L=********, O=*******, OU=IT, CN=******* CA, name=server, emailAddress=*****@gmail.com
Fri Jul 27 16:26:08 2018 BB.BBB.BBB.BBB:3894 VERIFY OK: depth=0, C=BE, ST=**, L=********, O=*******, OU=IT, CN=client-pc, name=server, emailAddress=*****@gmail.com
Fri Jul 27 16:26:08 2018 BB.BBB.BBB.BBB:3894 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri Jul 27 16:26:08 2018 BB.BBB.BBB.BBB:3894 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Jul 27 16:26:08 2018 BB.BBB.BBB.BBB:3894 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri Jul 27 16:26:08 2018 BB.BBB.BBB.BBB:3894 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Jul 27 16:26:08 2018 BB.BBB.BBB.BBB:3894 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Fri Jul 27 16:26:08 2018 BB.BBB.BBB.BBB:3894 [client-pc] Peer Connection Initiated with [AF_INET]BB.BBB.BBB.BBB:3894
Fri Jul 27 16:26:08 2018 client-pc/BB.BBB.BBB.BBB:3894 OPTIONS IMPORT: reading client specific options from: ccd/client-pc
## --client-connect [client-pc]
Fri Jul 27 16:26:09 2018 client-pc/BB.BBB.BBB.BBB:3894 OPTIONS IMPORT: reading client specific options from: /tmp/openvpn_cc_9f674f3af26fff65f0d2f9795e5d749e.tmp
Fri Jul 27 16:26:09 2018 client-pc/BB.BBB.BBB.BBB:3894 MULTI: Learn: 10.8.0.154 -> client-pc/BB.BBB.BBB.BBB:3894
Fri Jul 27 16:26:09 2018 client-pc/BB.BBB.BBB.BBB:3894 MULTI: primary virtual IP for client-pc/BB.BBB.BBB.BBB:3894: 10.8.0.154
Fri Jul 27 16:26:11 2018 client-pc/BB.BBB.BBB.BBB:3894 PUSH: Received control message: 'PUSH_REQUEST'
Fri Jul 27 16:26:11 2018 client-pc/BB.BBB.BBB.BBB:3894 send_push_reply(): safe_cap=940
Fri Jul 27 16:26:11 2018 client-pc/BB.BBB.BBB.BBB:3894 SENT CONTROL [client-pc]: 'PUSH_REPLY,route 10.8.0.0 255.255.255.0,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.154 10.8.0.153' (status=1)
Fri Jul 27 16:27:18 2018 client-pc/AA.AAA.AAA.AAA:3260 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Jul 27 16:27:18 2018 client-pc/AA.AAA.AAA.AAA:3260 TLS Error: TLS handshake failed
Fri Jul 27 16:28:05 2018 client-pc/AA.AAA.AAA.AAA:3260 [UNDEF] Inactivity timeout (--ping-restart), restarting
Fri Jul 27 16:28:05 2018 client-pc/AA.AAA.AAA.AAA:3260 SIGUSR1[soft,ping-restart] received, client-instance restarting
## --client-disconnect [client-pc]
BB.BBB.BBB.BBB
is the new remote ip, while
AA.AAA.AAA.AAA
is the ip it was previously connected on.
Do you see a reason why the script order is not respected?