TinCanTech wrote: ↑Wed May 02, 2018 4:50 pm
And what else ?
Alright. Got more details for you.
This issue doesn't happen at all with TCP, regardless if iOS is using WiFi or cellular. UDP works if on WiFi (at home at least - have to find a friendly WiFi network out there that I trust and doesn't block UDP - guess I'll have to show up at a friend's with some beer). UDP does not work on cellular.
It's not a port problem either. Created a new instance on a different port and have the same issue.
I don't think its firewall or NAT related, as server sees the client and establishes the connection.
The server is oblivious to the problem. Log excerpts (removed all information I'd consider personal... not thinking it too much so if some IP's don't make sense that's my editing fault, not the server or the config):
STARTUP
Code: Select all
Thu May 3 21:34:50 2018 us=175343 OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Jul 25 2015
Thu May 3 21:34:50 2018 us=184445 library versions: OpenSSL 1.0.2f 28 Jan 2016, LZO 2.08
Thu May 3 21:34:50 2018 us=222655 Diffie-Hellman initialized with 2048 bit key
Thu May 3 21:34:50 2018 us=232857 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Thu May 3 21:34:50 2018 us=240772 Socket Buffers: R=[163840->131072] S=[163840->131072]
Thu May 3 21:34:50 2018 us=248853 TUN/TAP device tun0 opened
Thu May 3 21:34:50 2018 us=272664 TUN/TAP TX queue length set to 100
Thu May 3 21:34:50 2018 us=283027 do_ifconfig, tt->ipv6=1, tt->did_ifconfig_ipv6_setup=0
Thu May 3 21:34:50 2018 us=294908 /sbin/ifconfig tun0 <local IP> netmask 255.255.255.128 mtu 1500 broadcast <local mask>
Thu May 3 21:34:50 2018 us=346935 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Thu May 3 21:34:50 2018 us=382127 GID set to nogroup
Thu May 3 21:34:50 2018 us=396928 UID set to nobody
Thu May 3 21:34:50 2018 us=416783 UDPv4 link local (bound): [undef]
Thu May 3 21:34:50 2018 us=434152 UDPv4 link remote: [undef]
Thu May 3 21:34:50 2018 us=448532 MULTI: multi_init called, r=256 v=256
Thu May 3 21:34:50 2018 us=456239 IFCONFIG POOL: base=<local IP base> size=124, ipv6=0
Thu May 3 21:34:50 2018 us=463754 Initialization Sequence Completed
On WiFi, 1st connection (successful)
Code: Select all
Thu May 3 22:03:24 2018 us=71422 MULTI: multi_create_instance called
Thu May 3 22:03:24 2018 us=76937 <WiFi IP>:50214 Re-using SSL/TLS context
Thu May 3 22:03:24 2018 us=81827 <WiFi IP>:50214 LZO compression initialized
Thu May 3 22:03:24 2018 us=87549 <WiFi IP>:50214 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Thu May 3 22:03:24 2018 us=92395 <WiFi IP>:50214 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Thu May 3 22:03:24 2018 us=97327 <WiFi IP>:50214 TLS: Initial packet from [AF_INET]<gateway IP>:50214, sid=843ed6 762d7b
Thu May 3 22:03:25 2018 us=454797 <WiFi IP>:50214 VERIFY OK: <CA Details>
Thu May 3 22:03:25 2018 us=464522 <WiFi IP>:50214 VERIFY OK: <Cert Details>
Thu May 3 22:03:26 2018 us=233030 <WiFi IP>:50214 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu May 3 22:03:26 2018 us=238433 <WiFi IP>:50214 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu May 3 22:03:26 2018 us=243482 <WiFi IP>:50214 NOTE: --mute triggered...
Thu May 3 22:03:26 2018 us=254498 <WiFi IP>:50214 3 variation(s) on previous 5 message(s) suppressed by --mute
Thu May 3 22:03:26 2018 us=259742 <WiFi IP>:50214 [iPhone] Peer Connection Initiated with [AF_INET]<gateway IP>:50214
Thu May 3 22:03:26 2018 us=264720 iPhone/<WiFi IP>:50214 MULTI_sva: pool returned IPv4=<Device IP>, IPv6=(Not enabled)
Thu May 3 22:03:26 2018 us=269984 iPhone/<WiFi IP>:50214 MULTI: Learn: <Device IP> -> iPhone/<WiFi IP>:50214
Thu May 3 22:03:26 2018 us=274800 iPhone/<WiFi IP>:50214 MULTI: primary virtual IP for iPhone/<WiFi IP>:50214: <Device IP>
Thu May 3 22:03:26 2018 us=279931 iPhone/<WiFi IP>:50214 PUSH: Received control message: 'PUSH_REQUEST'
Thu May 3 22:03:26 2018 us=284752 iPhone/<WiFi IP>:50214 send_push_reply(): safe_cap=940
Thu May 3 22:03:26 2018 us=290084 iPhone/<WiFi IP>:50214 SENT CONTROL [iPhone]: 'PUSH_REPLY,comp-lzo yes,persist-key,persist-tun,topology subnet,route-gateway dhcp,route 0.0.0.0 128.0.0.0,route 128.0.0.0 128.0.0.0,dhcp-option DNS <Server IP>,route-gateway <Gateway IP>,topology subnet,ping 10,ping-restart 120,ifconfig <Device IP> 255.255.255.128' (status=1)
Thu May 3 22:04:06 2018 us=365857 iPhone/<gateway IP>:50214 IP packet with unknown IP version=2 seen
Disconnect client, disconnect from WiFi (go cellular), connect again
Code: Select all
Thu May 3 22:04:16 2018 us=547680 MULTI: multi_create_instance called
Thu May 3 22:04:16 2018 us=554946 <Cell IP>:60634 Re-using SSL/TLS context
Thu May 3 22:04:16 2018 us=559844 <Cell IP>:60634 LZO compression initialized
Thu May 3 22:04:16 2018 us=565404 <Cell IP>:60634 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Thu May 3 22:04:16 2018 us=570201 <Cell IP>:60634 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Thu May 3 22:04:16 2018 us=575106 <Cell IP>:60634 TLS: Initial packet from [AF_INET]<Cell IP>:60634, sid=695a6bfa 5019477d
Thu May 3 22:04:17 2018 us=921674 <Cell IP>:60634 VERIFY OK: <CA>
Thu May 3 22:04:17 2018 us=931321 <Cell IP>:60634 VERIFY OK: <CERT>
Thu May 3 22:04:18 2018 us=333886 <Cell IP>:60634 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu May 3 22:04:18 2018 us=339095 <Cell IP>:60634 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu May 3 22:04:18 2018 us=344279 <Cell IP>:60634 NOTE: --mute triggered...
Thu May 3 22:04:18 2018 us=382991 <Cell IP>:60634 3 variation(s) on previous 5 message(s) suppressed by --mute
Thu May 3 22:04:18 2018 us=388165 <Cell IP>:60634 [iPhone] Peer Connection Initiated with [AF_INET]<Cell IP>:60634
Thu May 3 22:04:18 2018 us=394527 MULTI: new connection by client 'iPhone' 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.
Thu May 3 22:04:18 2018 us=399342 MULTI_sva: pool returned IPv4=<Device IP>, IPv6=(Not enabled)
Thu May 3 22:04:18 2018 us=404558 MULTI: Learn: <Device IP> -> iPhone/<Cell IP>:60634
Thu May 3 22:04:18 2018 us=409362 MULTI: primary virtual IP for iPhone/<Cell IP>:60634: <Device IP>
Thu May 3 22:04:18 2018 us=414489 iPhone/<Cell IP>:60634 PUSH: Received control message: 'PUSH_REQUEST'
Thu May 3 22:04:18 2018 us=419306 iPhone/<Cell IP>:60634 send_push_reply(): safe_cap=940
Thu May 3 22:04:18 2018 us=424638 iPhone/<Cell IP>:60634 SENT CONTROL [iPhone]: 'PUSH_REPLY,comp-lzo yes,persist-key,persist-tun,topology subnet,route-gateway dhcp,route 0.0.0.0 128.0.0.0,route 128.0.0.0 128.0.0.0,dhcp-option DNS <Server IP>,route-gateway <Gateway IP>,topology subnet,ping 10,ping-restart 120,ifconfig <Device IP> 255.255.255.128' (status=1)
Thu May 3 22:04:19 2018 us=363700 iPhone/<Cell IP>:60634 IP packet with unknown IP version=2 seen
------>>>> NOTE: HERE HAPPENS THE CLIENT DISCONNECT AND RECONNECTION ATTEMPT... NOTHING SHOWS IN LOG... NEW CONNECTION STARTS BELOW <<<<<------
Thu May 3 22:04:24 2018 us=518110 MULTI: multi_create_instance called
Thu May 3 22:04:24 2018 us=523653 <Cell IP>:65186 Re-using SSL/TLS context
------>>>> NOTE: LOG REPEATS AS FROM LINE "Thu May 3 22:04:16 2018 us=559844" ABOVE <<<<<-----
So... the server is clueless of the iOS client having any issues. It just sees a new connection request every 5 seconds (and complains that session was already taken by client so old one will be lost - as per my config).
Problem is the iOS client or iOS itself. Once UDP connects, iOS is sensing WWAN unavailable. This causes the iOS client to drop the connection and reconnect. On WiFi there is no WWAN unavailable notification so connection is not dropped and it works.
Any suggestions?